Bangalore Posted September 26, 2014 Report Share Posted September 26, 2014 I want to set up Rules and I see that UK localization is not supported. How can I use dates in Rules??? Any suggestions? Quote Link to comment Share on other sites More sharing options...
GoCubbies Posted September 26, 2014 Report Share Posted September 26, 2014 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. nguyencamvnh 1 Quote Link to comment Share on other sites More sharing options...
Bangalore Posted September 26, 2014 Author Report Share Posted September 26, 2014 Thank you, will try this out and get back to you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.