Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82399

Formatting the hours available in 'datetime' fieldtype carries over to minutes and seconds

$
0
0

Hi!
I configured the datetime picker to allow a selection of pre-defined hours:

fields: [ {
                    label: 'PLOD Name',
                    name: 'plod'
                }, {
                    label: 'Shift Start',
                    name: 'shiftStart',
                    type: 'datetime',
                    format: 'YYYY-MM-DDTHH:mm:ss',
                    default: moment(new Date()).set({hour:shiftStart,minute:0,second:0}).format('YYYY-MM-DDTHH:mm:ss'),
                    opts: {
                        hoursAvailable: [18,0]
                    }
                }, 

However if I render the table/editor the datetime picker presents me with the same values (18 & 0) in the minute and second selection.
Furthermore, if I add these options to the field:

opts: {
                        hoursAvailable: [18,0],
                        minutesIncrement: 15,
                        secondsIncrement: 15
                    }

The minutes and seconds dropdown in the form render as 00 and cant be changed at all. No errors are given in the console.

I am using latest built of Datatables and Editor.
Cheers
Christian


Viewing all articles
Browse latest Browse all 82399


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>