Classic Form Builder Elements
The date-time widget allows the user to combine the functionality of both the date and time widget together.
The Date-Time Widget
You can set a dynamic time and/or date by using a page level javascript. Looking at the formula below, it will show you how to set a dynamic time or date. First, declare your variable. You can name it whatever you want, just as long as it is not used in the javascript language or a column name. Then type type new Date followed by a open parentheses. Each number represented a different aspect of time. The date parameters below will show 1988, April 12, 6:30 am. The last zero represents seconds, which no date widget offers.
yourVariable = new Date(1988,03,12,06,30,0);
There are a couple things to note. First, the second number for months, it works as an index value starting with zero. So January will be 0 and December will be 11. The hour number (where the 6 is) is based on 24 hour time. So for 6:30 pm, just change the 6 to 18. And lastly, this will work on all our date and time widgets without changing numbers. The date or time widget will only use the numbers that are applicable. For example, the time widget will only show 6:30 am.
Comments
0 comments
Article is closed for comments.