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

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

christiangeyerchristiangeyer Posts: 1Questions: 0Answers: 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

Replies

  • colincolin Posts: 15,174Questions: 1Answers: 2,589

    Hi @christiangeyer ,

    Yep, I'm seeing that too, see here, we'll take a nose and report back.

    Cheers,

    Colin

  • allanallan Posts: 61,920Questions: 1Answers: 10,152 Site admin

    Hi Christian,

    Thanks for letting us know about that. Indeed that was a bug in 1.8.0 and I've committed a fix for it now. It will be in 1.8.1 which I expect to be able to package up in the next day or so.

    Allan

This discussion has been closed.