set the useSystemDate to true
if fld txtDate is a date then put "true"
else put "false"
When I put a any number into the field then, say 1 or 123 or whatever, the validation results in "true" although it is not a valid date value. What am I doing wrong?
The "is a date" check is only checking if rev would convert the value to a date. Because of "the seconds", any integer is a date for rev. Every country enters date differently. So to make rev only accept valid dates, I suggest to check for formatting that are according to your local date requirements.
Obviously I have misunderstood the "is a date" check. Thank you very much for your example. I think I will go with it. Although, using a calendar entry widget would maybe be the better alternative. Would it be possible for you to post a link of such a control because my search within revOnline Samples was not successful?
Jörg,
Sarah Reichelt has posted on her website a calender stack. This stack has a substack that lets you choose a date. http://www.troz.net/rev/index.irev?cate ... ity#stacks
Sarah knows all about dates and time in Rev. She is THE expert.
You have to test it, I did not include it in any of my projects yet, but she explains how to do it.
regards
Bernd
yeah... there should be a central repository where everyone uploads their stacks and hints and such... and then everybody would use it because it'd be rad and such... yeah that'd be nice...
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Thanks to all! I think I will spend a bit of time to try the stacks. BvG, I think you are absolutely right with your suggestion that there should be a central repository. It would help definitely everybody! Craig, your "date-check", the combination of ... is a date ... and ... is not an integer ... is also a good approach but in my case a check of e.g. "14.123456" would result in "true" although this is not a date value is valid. But I think with additional checks (e.g. type of items and length) it would also work.
Joerg wrote:... is not an integer ... is also a good approach but in my case a check of e.g. "14.123456" would result in "true" although this is not a date value is valid. But I think with additional checks (e.g. type of items and length) it would also work.
regards
Jörg
Schnapp
There also is the expression "is a number" which could be more useful in your case. Also for german dates you could set the itemdel to "." and check the number of items (which would need to be 3 and all of them would need to be numbers)
on Windows you can use a tiny VBS Script as a workaround:
...
put "result = IsDate(" & QUOTE & the_date_in_question & QUOTE & ")" into tvb
do tvb as vbscript
put the result into is_a_date
## true or false
...
Tested with these (german! DD/MM/YYY) variations of a date:
01/01/1969
31/01/1969
31-01-1969
31.01.1969
31.01.69
01/01/69
31/01/69 ## Obvioulsy also works with english dates!
31-01-69
01/31/1969
31.1.69