Using latest showcase: http://www.smartclient.com/smartclient-latest/showcase/?id=emptyValues Build 2017-06-01
I've modified the sample below, changes in bold.
It seems than when using isc.Time.setDefaultDisplayTimezone in combination with datetimeFormatter, the datetimeFormatter doesn't respect the DefaultDisplayTimezone (or maybe ONLY respects it when using datetimeFormatter?). You can see this by enabling/disabling the datetimeFormatter line.
Is this by design? If so, why would something which is meant to format affect the value? Or is this a bug?
Edit: The pre-defined values for datetimeFormatter (i.e. toEuropeanShortDatetime, toJapanShortDatetime, toDateStamp, toSerializeableDate) seem to work fine (they don't change the value) so maybe it's just the custom formatting using a FormatString that doesn't work.
After reading the docs a little more carefully, I see that setting a custom FormatString is not supported for this property (although it sort-of works and it would be really nice if it was supported)
So, it looks like the proper way to get the formatting I want is to use the DateUtil.setNormalDiaplayFormat() method and pass in my format string. So, I tried this:
But the formatting doesn't change from the default. So, what am I doing wrong now?
I've modified the sample below, changes in bold.
It seems than when using isc.Time.setDefaultDisplayTimezone in combination with datetimeFormatter, the datetimeFormatter doesn't respect the DefaultDisplayTimezone (or maybe ONLY respects it when using datetimeFormatter?). You can see this by enabling/disabling the datetimeFormatter line.
Code:
[B]isc.Time.setDefaultDisplayTimezone("00:00");[/B] isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, data: countryData, [B]// datetimeFormatter: "M/d/yy H:mma", //<-- If you enable this line, then the VALUE changes as well as the format[/B] fields:[ {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false}, {name:"countryName", title:"Country", [B]width:50[/B]}, {name:"capital", title:"Capital", [B]width:50[/B]}, {name:"independence", title:"Nationhood", type:"[B]datetime[/B]", emptyCellValue:"--", [B]width:200[/B]} ], canEdit:true, editByCell:true, modalEditing:true, emptyCellValue: "unknown" })
Edit: The pre-defined values for datetimeFormatter (i.e. toEuropeanShortDatetime, toJapanShortDatetime, toDateStamp, toSerializeableDate) seem to work fine (they don't change the value) so maybe it's just the custom formatting using a FormatString that doesn't work.
After reading the docs a little more carefully, I see that setting a custom FormatString is not supported for this property (although it sort-of works and it would be really nice if it was supported)
Custom formatting can also be applied by passing a FormatString instead of a DateDisplayFormat string to DateUtil.setNormalDisplayFormat() et al. See the FormatString docs for details.
Code:
[B]isc.Time.setDefaultDisplayTimezone("00:00"); isc.DateUtil.setNormalDisplayFormat("M/d/yy H:mma"); //isc.DateUtil.setNormalDatetimeDisplayFormat("M/d/yy H:mma"); // <-- this doesn't work either[/B] isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, data: countryData, fields:[ {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false}, {name:"countryName", title:"Country", [B]width:50[/B]}, {name:"capital", title:"Capital", [B]width:50[/B]}, {name:"independence", title:"Nationhood", type:"[B]datetime[/B]", emptyCellValue:"--", [B]width:200[/B]} ], canEdit:true, editByCell:true, modalEditing:true, emptyCellValue: "unknown" })
Comment