Hey,
i just found this really cool functionality you guys have for Date/DateTimeItems, setUseMask to make it easier to enter datetime data. However, since our app is in Scandinavia, we want the format of datetime to be "YYYY-mm-dd HH:mm", which is not the way it is out of the box.
Therefor i do it in what i think is the "common" way, i.e. make DateUtil calls (see code below) to set custom formats. This has worked fine for years, but now it breaks the mask
Basically, since the format is one thing, but the mask apparently expects another format, it gets totally wobbled up and i cant even save the form. See attached screenshot.
Pleasse advice if there's anything i can do to make usemask work with my custom formatters (that i must have, all our customers expect it).
i just found this really cool functionality you guys have for Date/DateTimeItems, setUseMask to make it easier to enter datetime data. However, since our app is in Scandinavia, we want the format of datetime to be "YYYY-mm-dd HH:mm", which is not the way it is out of the box.
Therefor i do it in what i think is the "common" way, i.e. make DateUtil calls (see code below) to set custom formats. This has worked fine for years, but now it breaks the mask
Basically, since the format is one thing, but the mask apparently expects another format, it gets totally wobbled up and i cant even save the form. See attached screenshot.
Pleasse advice if there's anything i can do to make usemask work with my custom formatters (that i must have, all our customers expect it).
Code:
DateUtil.setNormalDateDisplayFormatter(constants.dateFormatter); DateUtil.setShortDateDisplayFormatter(constants.dateFormatter); DateUtil.setShortDatetimeDisplayFormatter(constants.datetimeFormatter); DateUtil.setDateParser(new DateParser() { public Date parse(String dateString) { try { return constants.dateTimeFormat.parse(dateString); } catch (IllegalArgumentException e) { try { return constants.dateFormat.parse(dateString); } catch (IllegalArgumentException e1) { } } return null; } });
Comment