I have a date-time field. I get a date picker but no time portion. How do I get the date-time picker to work in a form?
Turn on the “calendar display” option.
It is on, I only get the date portion? Can you show me an image of what it looks like?
I’m sorry,
My mistake. I have not read in sufficient detail.
You want to date and time picker together.
I tried but not this option.
Ok, thanks.
How could SC not have such a fundamental tool?
Hard to say.
Maybe you suggest to the development team to update this.
I usually use date and time field individually and have no problems.
however, I only use datetime for created_at and updated_at
How do I make a suggestion to the development team?
Send a message to sales at or bugs at scriptcase.net. To be honest, I don’t see much use as entering time is just hh:nn which goes way faster by hand than by mouse. But yeah, it should be available.
nonkelmike,
That is a time picker all right, but not a date-time picker for a date-time field.
do you know some library that can do the job? If yes we can try to implement it in SC
Try this https://trentrichardson.com/examples/timepicker/
And then you will need to replace #id_sc_field_f3 with your field in the form in the code below and alter this to suite the code supplied in the above link. You may be able to (or have to) use sc_include(“File”, “Source”) to add the addon to the jquery library
$script = "
src=‘https://code.jquery.com/ui/1.12.1/jquery-ui.js’;//You may be able to (or have to) use sc_include(“File”, “Source”) to add the addon to the jquery
$( function()
$( ‘#id_sc_field_f3’ ).datepicker({
changeYear: true , dateFormat: ‘yy-mm-dd’,yearRange: ‘2019:2025’
});
$( ‘#id_sc_field_f4’ ).datepicker({
changeYear: true , dateFormat: ‘yy-mm-dd’,yearRange: ‘2019:2025’
});
} )
";
echo “<script>” . $script . “</script>”;
I have used the above code in SC successfully in an onLoad of a form , and although I have not tried the timepicker addon above, I am pretty sure it will work