Forums

Separate Date and Time Pickers

har7801 29 Apr, 2018
Im almost there, one last hurdle to complete my masterpiece.

I am trying to have a seperate date picker, I have no problem getting this to work, and a separate time only picker, this is where I am falling down.

Screengrabs attached for reference.

I have changed formats, changed field names, changed everything, but just can't get it to do time. The picker itself works fine, but it puts todays date into the field instead of the time, then nothing is sent to the DB.

Can I not have 2 of these pickers in one form?

Thanks.
har7801 30 Apr, 2018
So I think I remember from days past that I could only have one picker, so I have settled on just doing a text field to collect the time that way. I am entering this:

data-inputmask:'mask' : '23:59'

into the extra attributes field but it doesn't restrict the input. Am I missing a step.

This is in CCv6

Ta
healyhatman 30 Apr, 2018
You can have two date pickers, one problem is you put the PHP format string in Format - you need to use the Moments.js format in that field.

Here's a list I made
https://www.chronoengine.com/forums/posts/t105375/calendar-date-format-options

Or here's the official page
https://momentjs.com/


The other problem is that it appears the calendar in CC is bugged, and it doesn't have all the properties set correctly.

One way you might be able to get around it is by creating a Calendar VIEW, and in your Fields view instead of adding a calendar there add a "Custom" element, with {view:yourcalendar}. At least until they fix it.
har7801 30 Apr, 2018
Thanks, these are the setting I now have in the dialogue boxes, it will now write to the DB, the picker for time comes up with time only, the hours first then the minutes, but when you select them it only copies in today's date, even though you didnt select a date?

healyhatman 30 Apr, 2018
It appears to be bugged. I edited my first reply with some suggestions, and created a post in the CC Bug subforum.
har7801 30 Apr, 2018
Ok, as long as its not just me. Any suggestions on the setting a data mask instead?
healyhatman 30 Apr, 2018
Yeah one suggestion: don't. Certain combinations break input on Android devices.
This topic is locked and no more replies can be posted.