Setting date-time fields
-
- Posts: 17
- Joined: Tue Dec 17, 2013
How does one set, in javascript, the date, hour and minute fields? Are there special break characters in a string or Date object? Thanks
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
You should pass an array into date and time field:
You should pass an array into date and time field:
Code: Select all
fd.field('DateTime').value(['3/19/2014', '9 AM', '40'])
-
- Posts: 76
- Joined: Wed Jan 21, 2015
Can the time range be set? Instead of 24 hours 8am 8pm?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
You can change time format in the regional settings of the site:
Site Settings -> Regional settings -> Time format.
You can change time format in the regional settings of the site:
Site Settings -> Regional settings -> Time format.
-
- Posts: 76
- Joined: Wed Jan 21, 2015
I am talking about the control on the list forms only showing options from 8am to 8pm. The regional settings are set from 8am to 8pm, but the date time picker still shows full 24 hour time period.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Got it. You can remove redundant options with the help of JavaScript:
Replace DateTime in the code above with the internal name of you date and time field.
Code: Select all
fd.field('DateTime').control()._el().find('select:eq(0) > option').filter(function() { return $(this).index() < 8 || $(this).index() > 20 }).remove()
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests