jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Problem with showing a date
This topic contains 9 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 3 months ago.
-
Author
-
My problem is that my database (Microsoft SQL Server) I have a date field, but to display it in the grid using internet explorer, the date time aren’t correctly displayed.
using the following line:
{text: ‘Date’, ColumnGroup: ‘Events’ datafield’ Date ‘, cellsformat:’ dd-MM-yyyy HH: mm: ss’, width: ‘28% ‘},the hour an minutes aren’t correctly, it appears 01 in hour and 00 in minutes.
How can i solve it?I use internet explorer 8.0.7601.17514
Ho wormie007,
Sometimes, it is necessary to describe your date’s format when you define the data fields array of your data source object.
Ex: { name: ‘SubmitDate’, type: ‘date’, format: “yyyy-MM-ddTHH:mm:ss-HH:mm” }
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comSorry but it doesn’t work.
Do you knwo another possible cause for this kind of problem?
Hi wormie007,
Could you send us a sample which demonstrates your scenario and we will take a look at it?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comvar source =
{
datatype: “xml”,datafields: [
{ name: ‘IdAplicacion’, type: ‘int’ },
{ name: ‘Categoria’, type: ‘string’ },
{ name: ‘IdAplicacion’, type: ‘int’ },
{ name: ‘Fecha’, type: ‘date’, format: ‘yyyy-MM-ddTHH:mm:ss-HH:mm’ },
{ name: ‘Usuario’, type: ‘string’ },
{ name: ‘Ubicacion’, type: ‘string’ },
{ name: ‘Descripcion’, type: ‘string’ },
{ name: ‘Contenido’, type: ‘string’ }
],
async: false,
record: ‘Table’,
pagesize: 10,
url: ‘Metodos.aspx/GetEvento’};
$(“#jqxgrid”).jqxGrid(
{
source: dataAdapter,
theme: theme,
width: ‘80%’,
editable: false,
statusbarheight: 45,
showtoolbar: true,
sortable: true,
pageable: true,
filterable: false,
autoheight: true,
autorowheight: false,
columnsreorder: true,
autoshowfiltericon: false,
localization: getLocalization(),
columnsresize: true,rendertoolbar: function (toolbar) {
var container = $(“<div style=’text-align:center;’></div>”);
var title = $(“<b>Administracion de Eventos</b>”);
container.append(title);
toolbar.append(container);
},columns: [
{ text: ‘Id Aplicacion’, columngroup: ‘Eventos’, datafield: ‘IdAplicacion’, width:’12%’ },
{ text: ‘Categoria’, columngroup: ‘Eventos’, datafield: ‘Categoria’, width: ‘12%’ },{text: ‘Fecha’, columngroup: ‘Eventos’, datafield: ‘Fecha’, cellsformat: ‘dd-MM-yyyyTHH:mm:ss’, width: ‘28%’ },
{ text: ‘Usuario’, columngroup: ‘Eventos’, datafield: ‘Usuario’, width: ‘12%’ },
{ text: ‘Ubicacion’, columngroup: ‘Eventos’, datafield: ‘Ubicacion’, width: ‘12%’ },
{ text: ‘Descripcion’, columngroup: ‘Eventos’, datafield: ‘Descripcion’, width: ‘12%’ },
{ text: ‘Contenido’, columngroup: ‘Eventos’, datafield: ‘Contenido’, width: ‘12%’ },
],
columngroups: [
{ text: ‘Eventos’, align: ‘center’, name: ‘Eventos’ }
]
});
});I think this is all you needed.
Hi wormie007,
That’s almost what I need. Could you send a sample of your data so I can check whether the “format” is correct for your case. It should match the Date format of your data source.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/a sample of a date that i have in my source is like 14/03/2014 17:09:44
Hi wormie007,
This means that the format for you should be: format: ‘dd/MM/yyyy HH:mm:ss’
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/I have tested in firefox and it works fine, but in internet explorer that i cite you above, it doesn’t work, and would need to be for the explorer. Have you kow a patch or something to solve it?
Hi wormie007,
We cannot reproduce such issue with IE8 which means that we cannot provide a patch for something which we can’t verify. If you wish, provide a sample which demonstrates a problem and which we can test, because the code from your post does not have data and we can’t test it in the way it is now. You can use jsfiddle.net to prepare online sample.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.