I have a custom editor in Umbraco which is a Date Picker but instead of date it uses HH:mm format, so it's essentialy a Time Picker editor. Currently you pick through hours 1-24 and minutes 1-60 but what I want to do is make the step value on the minutes as 15 so that we instead pick between minutes 0-15-30-45, but I can't figure out a way to set this up. Any ideas how I can achieve this? I know it uses/supports the momentjs library but I can't find a way to make it work with anything I found in momentjs.
The date picker in Umbraco core is based on Flatpickr library, so it may be possible to configure this, but probably not from the current data type configuration.
Hi Bjarne, my mistake on this one. Apparently we only use the Umbraco date picker in the backoffice whereas in the actual view we are using a different date picker based on momentjs. (not using traditional forms, it's a custom made form)
Setting step value in a time picker
I have a custom editor in Umbraco which is a Date Picker but instead of date it uses HH:mm format, so it's essentialy a Time Picker editor. Currently you pick through hours 1-24 and minutes 1-60 but what I want to do is make the step value on the minutes as 15 so that we instead pick between minutes 0-15-30-45, but I can't figure out a way to set this up. Any ideas how I can achieve this? I know it uses/supports the momentjs library but I can't find a way to make it work with anything I found in momentjs.
Hi Ras
The date picker in Umbraco core is based on Flatpickr library, so it may be possible to configure this, but probably not from the current data type configuration.
I am not sure if you can override the configuration directly, but alternatively you can add a custom property editor using the
<umb-date-time-picker>
component: https://github.com/umbraco/Umbraco-CMS/blob/v10/contrib/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.htmlIt seems it is possible to use the
minuteIncrement
option where default value should be 5. https://stackoverflow.com/questions/61279712/flatpickr-is-it-possible-to-set-time-to-15-minute-intervalshttps://flatpickr.js.org/options/
Hi Bjarne, my mistake on this one. Apparently we only use the Umbraco date picker in the backoffice whereas in the actual view we are using a different date picker based on momentjs. (not using traditional forms, it's a custom made form)
is working on a reply...