CubicleGuy
asked on
How do I set/initialize a DateField to today's date -7 days?
I have a couple of places where I need to set a DateField to Today - 7 days, and another to Today - 30 days. Further, the user should not be able to select or input a date greater than the current date.
This should be simple, but the books I'm referencing make it seem convoluted...
Thanks in advance.
Chris
This should be simple, but the books I'm referencing make it seem convoluted...
Thanks in advance.
Chris
ASKER
I was right - it was not intuitive.
Thanks - I'll work on this immediately and get back with you.
Thanks - I'll work on this immediately and get back with you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you - I will be back on this soon. I wasn't aware that, in terms of the Object parameter for selectableRange(), that you could supply only one (min or max).
thanx 4 axxepting
Take that number and subtract/add the number of milliseconds you need.
Then use date.setTime(newNumber) with the new number to set the date value.
See example below:
Open in new window