Hi,
how can I format a dimension (datetime) in pivot grid?
I tried with this but it doesn't work:
//memberProvider: function (item) { return item.date; }memberProvider: function (item) { return $.formatNumber(item.date, { format: "dd/MM/yyyy" }); }
Hello Giovanni,
Thank you for posting in our forum.
What type is the value that you are trying to format?
Ignite UI has a $.ig.formatter function that you can use to format your values:
https://github.com/IgniteUI/ignite-ui/blob/master/src/js/modules/infragistics.util.jquery.js#L624
You can use it by providing the value, the value type (date, number etc.) and the format.
For example, if you are aiming to format a value of type date the code would look as follows:
$.ig.formatter(dateValue, "date", "dd/MM/yyyy")
I hope you’ll find this information useful. I’m looking forward to your reply.
Sorry but it doesn't work.
I have a datetime value and I'm trying to convert to dd/mm/yyyy format.
This is my code:
dimensions: [ { name: 'data', caption: 'data', hierarchies: [{ name: 'data', caption: 'data', levels: [ { name: 'data', caption: 'data', memberProvider: function (item) { return $.ig.formatter(item.data, "date", "dd/MM/yyyy"); } } ] }] },
It view 2018-03-30T00:00:00