RE:DATE INPUT FIELD WITH MM/DD/YYYY FORMAT

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE:DATE INPUT FIELD WITH MM/DD/YYYY FORMAT

Reddy, Gopikrishna
Hi Thanks alot for the help as this works fine with dd/mm/yyyy format and it restricts to less than currentdate,
Can anyone please help how to make it as MM/DD/YYYY FORMAT as this is very urgent to me
 
 
 
 <xhtml:head>
  <xhtml:title>Date Format entry</xhtml:title>
  <xforms:model>
   <xforms:instance id="instance">
    <instance>
     <mydate />
     <iso-date />
    </instance>
   </xforms:instance>
   <xforms:bind nodeset="/instance/iso-date" type="xs:string"
    calculate="
            replace(
                /instance/mydate,
                '(\d{2})(/)(\d{2})(/)(\d{4})',
                '$5-$3-$1'
            )" />
   <xforms:bind nodeset="/instance/mydate"
    type="xs:string"
    constraint="if (matches(., '(\d{2})/(\d{2})/(\d{4})'))
            then (
                if (/instance/iso-date castable as xs:date)
                then (xs:date(/instance/iso-date) &lt; (current-date()))
                else false()
           ) else false()" />
  </xforms:model>
 </xhtml:head>
 <xhtml:body>
  <xforms:input ref="mydate" incremental="true">
   <xforms:hint>Date in DD/MM/YYYY format</xforms:hint>
   <xforms:help>Enter Date in DD/MM/YYYY format; must be lesser then actual date</xforms:help>
   <xforms:alert>Invalid date: should be DD/MM/YYYY and before actual date</xforms:alert>
  </xforms:input><xhtml:br />
  <widget:xforms-instance-inspector xmlns:widget="<A href='http://orbeon.org/oxf/xml/widget"/'>http://orbeon.org/oxf/xml/widget"/>
 </xhtml:body>
</xhtml:html>
 
 
 
Thanks in advance,
K Gopikrishna Reddy
This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately 
by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws