I am trying to turn a previously date only field to a date-time field but it is not working.
I have:
schema: {
model: {
id: 'id',
fields: {
dateCreated: {
type: "date", format: "{0:yyyy/MM/dd HH:mm}", editable: "false"
},
...
}
}
But this doesn't work, the date comes out formatted properly but the time ends up being 00:00.
If I change the field type to "string" the data shows properly but is formatted the SQL way i.e:
2012-05-11 12:56:29
There is no such field type as "datetime", only "date". How do I get this to output how I want? i.e:
11/05/2012 12:56
Any one have any ideas?
Renders a general date/time pattern (long time) ( "M/d/yyyy h:mm:ss tt" for en-US). For example, kendo. toString(new Date(2000, 10, 6), "G") -> 11/6/2000 12:00:00 AM . Render a month/day pattern ( "MMMM dd" for en-US).
Press CTRL+1. In the Format Cells box, click the Number tab. In the Category list, click Date, and then choose a date format you want in Type.
Kendo is a martial art that is based on Japanese swordsmanship techniques. Practitioners use bamboo swords and wear protective armor.
You must use a template '#= kendo.toString(kendo.parseDate(dateCreated), 'MM/dd/yyyy HH:mm tt')#'
Where are you trying to use this data? If you're using it in a grid, you can use the 'template' property in the column definition
var columnDefinition = [
{
field: "dateCreated",
title: "Created",
template: "#= kendo.toString(dateCreated,'MM/dd/yyyy HH:mm tt') #"
}
];
Here's a fiddle with the formatting in a grid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With