Jump to content

Uk Localization Is Not Supported For Date Format Dd/mm/yyyy?


Recommended Posts

Yes, this feature certainly  needs to be implemented.

In the meantime, I have a simple script for you to make this work.

 

<SCRIPT LANGUAGE="JavaScript">

document.getElementById("InsertRecordsecond").parentNode.parentNode.style.display = 'none';

 

function checkStart()

{

var enteredValue = document.getElementById("InsertRecordfirst").value;

var formatday = enteredValue.search("/")+1;

var textday = enteredValue.substring(0,formatday);

var monthyear = enteredValue.substring(formatday);

var formatmonth = monthyear.search("/")+1;

var textmonth = monthyear.substring(0,formatmonth);

var onlyyear = monthyear.substring(formatmonth);

enteredValue = textmonth + textday + onlyyear;

 

var enteredDate = new Date(enteredValue);

var ruleDate = new Date();

ruleDate.setDate(26);

ruleDate.setMonth(8);

ruleDate.setFullYear(2014);

ruleDate.setHours(0);

ruleDate.setMinutes(0);

ruleDate.setSeconds(0);

   if (enteredDate<ruleDate)

      {

         document.getElementById("InsertRecordsecond").parentNode.parentNode.style.display = 'none';

       }

else

{

         document.getElementById("InsertRecordsecond").parentNode.parentNode.style.display = '';

       }

}  

 

document.getElementById("InsertRecordfirst").onchange=checkStart;

</SCRIPT>

 

The code hides the “InsertRecordsecond†field.

When the “InsertRecordfirst†field is changed, if the date from the “InsertRecordfirst†field is more than ruleDate, the “InsertRecordsecond†field is displayed, else it is hidden.

A user can enter his/her day = setDate(26), month, January is 0 = setMonth(8), year = setFullYear(2014).

There are also Hours, Minutes, Seconds, if it is required.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...