Date and Time Properties

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Date and Time Properties

aceospade
Hello I am also in the process of trying to learn how to display date
and times like in a calendar of sorts where you have inputs that
reference to certain days. Is there any pointers or specific things I
should be looking at? I am trying to create my own calendar with
corresponding days, months and years. What would be most helpful in
creating this? Thanks again,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Date and Time Properties

Aaron Reed
Hi Matthew,

If you want to see how to skin our controls, you could look at:
http://developer.mozilla.org/en/docs/XForms:Custom_Controls.  You could
also look at our current calendar control:
http://mxr.mozilla.org/mozilla/source/extensions/xforms/resources/content/input-xhtml.xml#208.
  The CSS rules that we use are at:
http://mxr.mozilla.org/mozilla/source/extensions/xforms/resources/content/xforms.css#372 
and
http://mxr.mozilla.org/mozilla/source/extensions/xforms/resources/content/xforms.css#367

Let me know if you have any other questions,
--Aaron


aceospade wrote:
> Hello I am also in the process of trying to learn how to display date
> and times like in a calendar of sorts where you have inputs that
> reference to certain days. Is there any pointers or specific things I
> should be looking at? I am trying to create my own calendar with
> corresponding days, months and years. What would be most helpful in
> creating this? Thanks again,
> Matthew
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Date and Time Properties

aceospade
I was actually trying to do this using only XForms, is that possible?
Thanks,
Matthew


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Date and Time Properties

Aaron Reed
Depends on how accurate you want it to be.  Just have 3 instance nodes
bound to 3 input controls (one each for year, month, day).  Then put
some kind of type on each node so that the control will show as invalid
if someone tries to put in a string, for example.  You could even use
the schema types for gYear, gMonth, gDay if you are ok with the format
of each.  Then you might want to go as far as adding logic for February
to account for leap years.  Things like that.  But I don't know of any
example of someone doing a date control like that.

--Aaron


aceospade wrote:
> I was actually trying to do this using only XForms, is that possible?
> Thanks,
> Matthew
>
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Date and Time Properties

Klotz, Leigh
In reply to this post by aceospade
Do you mean this?

<?xml version="1.0"?>

<html xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms">
  <head>
    <title>Birthday</title>
    <xf:model>
      <xf:instance>
        <data xmlns="">
          <birthday />
        </data>
      </xf:instance>
      <xf:bind nodeset="birthday" type="xsd:date" />
    </xf:model>
  </head>
  <body>
    <h1>Birthday</h1>
    <xf:input ref="birthday" incremental="true">
      <xf:label>Birthday</xf:label>
    </xf:input>
    <br />
    <p>Your birthday is <xf:output ref="birthday" />.</p>
  </body>
</html>

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
aceospade
Sent: Friday, August 03, 2007 11:42 AM
To: [hidden email]
Subject: Re: Date and Time Properties

I was actually trying to do this using only XForms, is that possible?
Thanks,
Matthew


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Date and Time Properties

aceospade
In reply to this post by aceospade
Not exactly. This needs to have a date selected from the calendar then
it relates to input dialog boxes just from typing in the date. Say you
have an edit box, the number in this case would be the edit box. Then
when clicked it would pull up a modal message box that would allow
inputs. I think it has something to do with bindings but I'm not real
sure. Thanks for your help on this.
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Date and Time Properties

Klotz, Leigh
I'm not getting the picture yet.

The example I sent lets you select a date from the calendar.

You'd like to have an input box in addition to the calendar that lets
you type in just the day number of the month?

By "modal message box that would allow inputs" do you mean the date
picker popup that resuls from my previous example?

There's no way in XForms 1.0 or 1.1 to have an xf:message with arbitrary
inputs.  Some implementations allow it, but others felt strongly it
should be disallowed, so the result is you can't depend on it.  I don't
think Mozilla allows it.  The date picker, though, is its own popup, and
as Aaaron Reed pointed out, you can customize these types of behaviors
in Mozilla using XBL.

Sorry if I'm not helpful, but we can keep trying.

Leigh.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
aceospade
Sent: Wednesday, August 08, 2007 8:03 AM
To: [hidden email]
Subject: Re: Date and Time Properties

Not exactly. This needs to have a date selected from the calendar then
it relates to input dialog boxes just from typing in the date. Say you
have an edit box, the number in this case would be the edit box. Then
when clicked it would pull up a modal message box that would allow
inputs. I think it has something to do with bindings but I'm not real
sure. Thanks for your help on this.
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms