@aemforms/af-formatters 0.22.43 → 0.22.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +6 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -69,8 +69,13 @@ const format = function (value, locale, skeleton, timezone) {
69
69
 
70
70
  switch (category) {
71
71
  case 'date':
72
+ // var date = new Date("2011-09-24");
73
+ // console.log(date);
74
+ // Fri Sep 23 2011 20:00:00 GMT-0400 (Eastern Daylight Time)
75
+ // to fix the above issue,
72
76
  if (!(value instanceof Date)) {
73
- value = new Date(value);
77
+ // this will take care of time zones other than GMT also
78
+ value = new Date(value.replace(/-/g, '\/').replace(/T.+/, ''));
74
79
  }
75
80
 
76
81
  return (0, _index.formatDate)(value, locale, skelton, timezone);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-formatters",
3
- "version": "0.22.43",
3
+ "version": "0.22.45",
4
4
  "description": "Formatting Module for Forms Runtime",
5
5
  "author": "Adobe Systems",
6
6
  "license": "Adobe Proprietary",