jQWidgets Forums
jQuery UI Widgets › Forums › Editors › DateTimeInput › how to display the date value in the format YYYY-MM-DD in the jqxgrid
Tagged: grid formatting
This topic contains 14 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 11 months ago.
-
Author
-
July 3, 2013 at 1:34 pm how to display the date value in the format YYYY-MM-DD in the jqxgrid #24409
Hi,,
I have to obtain the date value from the database which is given in the format YYYY-MM-DD and display in the jqxgrid in the same format,,,
I have used the following code:
text : ‘Start Date’, id: ‘startDatePopUp’,datafield : ‘startDate’, columntype: ‘datetimeinput’, cellsformat: ‘MMM yyyy’, align : ‘center’, width : 150, cellsalign : ‘center’,
but it is being displayed in the grid as YYYY-MM-DD 00:00:00.0
how will I display the date value in the format YYYY-MM-DD in the jqxgrid??
Thanks & Regards,
ssp
July 3, 2013 at 1:57 pm how to display the date value in the format YYYY-MM-DD in the jqxgrid #24424Hi,
The cellsformat specifies the display format in the Grid. In the posted code it is ‘MMM yyyy’, not ‘yyyy-MM-dd’. In addition, make sure that the datafield’s type property is set to “date” during the datafields array initialization in the source object.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/July 5, 2013 at 5:02 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24532Hi,
I get the same display format i.e. YYYY-MM-DD 00:00:00.0 even after changing the cellsformat:
text : ‘Start Date’, id: ‘startDatePopUp’,datafield : ‘startDate’, columntype: ‘date’, cellsformat: ‘yyyy-MM-dd’, align : ‘center’, width : 150, cellsalign : ‘center’,
tried with both columntype: ‘date’ and columntype: ‘datetimeinput’
Do you mean datafields array initialization in the database:
in my oracle db, the initialization is Date and is in the Date format only without having any time values….Thanks & Regards,
ssp
July 5, 2013 at 5:06 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24533Hi,
I meant the datafields initialization in the source object which you pass to the jqxDataAdapter plug-in.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/July 5, 2013 at 5:55 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24536Hi,
I have set the datafields initialization in the following way,
var milestone =
{
datatype: “json”,
datafields: [
{ name: ‘milestoneType’, type: ‘string’},
{ name: ‘phase’, type: ‘string’},
{ name: ‘phaseDescription’, type: ‘string’},
{ name: ‘customPhase’, type: ‘string’},
{ name: ‘startDate’, type: ‘date’},
{ name: ‘endDate’, type: ‘date’}],
cache: false,
url: ‘milestoneJCI.htm’};
.
.
.
initeditor: function (row, cellvalue, editor) {
editor.jqxDateTimeInput(‘setDate’, new Date());
}Thanks & Regards,
ssp
July 5, 2013 at 9:01 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24577Hi,
Sorry I forgot to mention, though I am initializing the property of Date column as type: ‘date’,
I am not able to remove the timestamp values from the Date : YYYY-MM-DD 00:00:00.0I have set the datafields initialization in the following way,
var milestone =
{
datatype: “json”,
datafields: [
{ name: ‘milestoneType’, type: ‘string’},
{ name: ‘phase’, type: ‘string’},
{ name: ‘phaseDescription’, type: ‘string’},
{ name: ‘customPhase’, type: ‘string’},
{ name: ‘startDate’, type: ‘date’},
{ name: ‘endDate’, type: ‘date’}],
cache: false,
url: ‘milestoneJCI.htm’};
.
.
.
initeditor: function (row, cellvalue, editor) {
editor.jqxDateTimeInput(‘setDate’, new Date());
}Please let me know how can I display only the Date in the grid in the format : YYYY:MM:DD ???
Thanks & Regards,
ssp
July 5, 2013 at 10:51 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24589Hi,
How to display Date in the grid cell in the format YYYY-MM-DD?
because in ,
text : ‘Start Date’, id: ‘startDatePopUp’,datafield : ‘startDate’, columntype: ‘date’, cellsformat: ‘yyyy-MM-dd’, align : ‘center’, width : 150, cellsalign : ‘center’,the cellFormat doesn’t work for any of the formats in the grid other than the YYYY-MM-DD 00:00:00.0
Thanks & Regards,
ssp
July 9, 2013 at 11:56 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24816Hi,
If the width size of the grid cell is reduced, those timestamp wont be shown,
but I am supposed to truncate those timestamp values without changing the width size from 150!
How can it be done??
Thanks & Regards,
ssp
July 9, 2013 at 12:17 pm how to display the date value in the format YYYY-MM-DD in the jqxgrid #24823Hi,
– Could you please, provide a complete sample which illustrates the behavior?
– Could you share with us which version of jQWidgets you use and which browser do you use?Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/July 9, 2013 at 12:53 pm how to display the date value in the format YYYY-MM-DD in the jqxgrid #24834Hi Peter,
Thanks for the reply!
I am using the version ‘jquery-1.7.2.min.js’, and the browser which I am currently using is IE9.The sample of my snippet goes as follows:
var milestone =
{
datatype: “json”,
datafields: [
{ name: ‘milestoneType’, type: ‘string’},
{ name: ‘phase’, type: ‘string’},
{ name: ‘phaseDescription’, type: ‘string’},
{ name: ‘customPhase’, type: ‘string’},
{ name: ‘startDate’, type: ‘date’},
{ name: ‘endDate’, type: ‘date’}],
cache: false,
url: ‘milestoneJCI.htm’
};var dataAdapter = new $.jqx.dataAdapter(milestone);
$(“#milestoneGridForJCI”).jqxGrid(
{
width : 900,
height : 227,
source : dataAdapter,
theme : theme,
editable : true,
showstatusbar : true,
statusbarheight : 00,
showaggregates : true,
selectionmode : ‘multiplecellsadvanced’,
columns : { text: ‘Start Date’, datafield: ‘startDate’, columntype: ‘datetimeinput’, width: 150, cellsalign: ‘center’, cellsformat: ‘MMM yyyy’,
validation: function (cell, value) {
var flag = dateValidation(cell,value,”Start Date”);
return flag;
},
initeditor: function (row, cellvalue, editor) {
editor.jqxDateTimeInput(‘setDate’, new Date());}
},]
July 9, 2013 at 1:07 pm how to display the date value in the format YYYY-MM-DD in the jqxgrid #24841Hi,
– I did not understand which version of jQWidgets do you use?
– I still cannot test that code because it does not have any data for testing. The provided code will display an Empty Grid. I am afraid that I cannot test a Date parsing without sample data.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/July 10, 2013 at 6:58 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24911Hi Peter,
The jqWidgets version I am using currently is 2.7.0.
The same code which i posted earlier, when I test in GOOGLE CHROME, the date is being displayed in the required format which I want, without timestamp such as ‘Jul 2013’. But the same snippet is not working in IE9. So, I guess this is browser issue. I want the same format ‘Jul 2013’ to be displayed in IE9 as well.July 10, 2013 at 7:42 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24919Hi,
That version is no longer actual. The reason behind releasing new versions is that we do fixes and improvements in jQWidgets. The current version is 2.9.2 and I suggest you to upgrade to it in case you wish from us to test something.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/July 10, 2013 at 11:53 am how to display the date value in the format YYYY-MM-DD in the jqxgrid #24931Peter,
I upgraded the version to 2.9.2, but the condition hasn’t changed,
i.e I get timestamp values appending the date in IE9, whereas in GOOGLE CHROME only ‘MMM yyyy’ is displayed properly!!July 10, 2013 at 12:04 pm how to display the date value in the format YYYY-MM-DD in the jqxgrid #24932Hi,
Ok, then could you provide us a Full Sample which demonstrates your scenario, not just part of the code. Otherwise, we will not be able to help. In addition, if you just upgraded to 2.9.2, then make sure you cleared your browser’s history, before testing again.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.