ywana-core8 0.0.230 → 0.0.231

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.
package/dist/index.umd.js CHANGED
@@ -1040,6 +1040,7 @@
1040
1040
  var FORMATS = {
1041
1041
  NONE: '',
1042
1042
  DATE: 'date',
1043
+ TIME: 'time',
1043
1044
  EMAIL: 'email',
1044
1045
  HTML: 'HTML',
1045
1046
  URL: 'URL'
@@ -1626,10 +1627,23 @@
1626
1627
  return o.value === value;
1627
1628
  }) : null;
1628
1629
  var text = option ? option.label : value;
1630
+ var locale = window.navigator.userLanguage || window.navigator.language;
1629
1631
 
1630
1632
  switch (format) {
1631
1633
  case FORMATS.DATE:
1632
- text = new Date(text).toLocaleString();
1634
+ text = new Date(text).toLocaleString(locale, {
1635
+ year: 'numeric',
1636
+ month: 'numeric',
1637
+ day: 'numeric'
1638
+ });
1639
+ break;
1640
+
1641
+ case FORMATS.TIME:
1642
+ text = new Date(text).toLocaleString(locale, {
1643
+ year: 'hour',
1644
+ month: 'minute',
1645
+ day: 'second'
1646
+ });
1633
1647
  break;
1634
1648
  }
1635
1649