datepicker format on datetime field
datepicker format on datetime field
Hello everyone,
I am new to this forum.
I've been trying and reading for hours but I'm still having problems with the datepicker.
How can I format a datepicker for a datetime field like this: d.m.Y H: i
******* Source ********
....
Editor :: inst ($ db, 'a53_cc_zeiten')
-> fields (
Field :: inst ('Name')
-> validator (Validate :: notEmpty (ValidateOptions :: inst ()
-> message ('Name required field')
)),
Field :: inst ('datetime')
-> getFormatter ('Format :: datetime', array (
'from' => 'Y-m-d H: i: s',
'to' => 'd.m.Y H: i'
))
-> setFormatter ('Format :: datetime', array (
'from' => 'd.m.Y H: i',
'to' => 'Y-m-d H: i: s'
)),
...
AND
....
$ (document) .ready (function () {
editor = new $ .fn.dataTable.Editor ({
ajax: "controllers / staff2.php",
table: "#example",
fields: [{
label: "Name:",
name: "Name"
}, {
label: "Timestamp:",
name: "datetime",
type: "datetime",
def: function () {return new Date (); },
dateFormat: "d.m.Y H: m"
},
....
It works fine with manual input, but the datepicker still formats to Y-m-d
thank you for your help
Answers
I would say send it as, if it's in ISO 8601 format, and use the formatting on the field definition on the client with
wireFormat
anddisplayFormat
. This example demonstrates that,Colin