@zohodesk/components 1.0.0-alpha-274 → 1.0.0-alpha-275

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/README.md CHANGED
@@ -32,6 +32,10 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.0.0-alpha-275
36
+
37
+ - **DateTime** - millisecond and second should work only when customDateFormat is given issue fixed. this fix related to *1.0.0-alpha-272*
38
+
35
39
  # 1.0.0-alpha-274
36
40
 
37
41
  - **AppContainer** - needTooltip prop added
@@ -205,9 +205,15 @@ export default class DateTime extends React.PureComponent {
205
205
  let milliSec = currentDate.getMilliseconds();
206
206
 
207
207
  if (isDateTimeField || customDateFormat) {
208
- selectedInMillis = datetime.tz.tzToUtc(Date.UTC(year, month, date, hours, mins, sec, milliSec), timeZone);
208
+ const dateArgs = [year, month, date, hours, mins];
209
+
210
+ if (customDateFormat) {
211
+ dateArgs.push(sec, milliSec);
212
+ }
213
+
214
+ selectedInMillis = datetime.tz.tzToUtc(Date.UTC(...dateArgs), timeZone);
209
215
  selectedValue = datetime.ISO(selectedInMillis);
210
- formattedValue = formatDate(new Date(year, month, date, hours, mins, sec, milliSec), customDateFormat == null ? is24Hour ? `${dateFormat} HH:mm:ss` : `${dateFormat} hh:mm:ss A` : `${customDateFormat}`);
216
+ formattedValue = formatDate(new Date(...dateArgs), customDateFormat == null ? is24Hour ? `${dateFormat} HH:mm:ss` : `${dateFormat} hh:mm:ss A` : `${customDateFormat}`);
211
217
  } else {
212
218
  selectedInMillis = Date.UTC(year, month, date);
213
219
  selectedValue = formatDate(new Date(year, month, date), 'YYYY-MM-DD');
@@ -41,6 +41,8 @@ var _dateFormatUtils = require("./dateFormatUtils");
41
41
 
42
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
43
43
 
44
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
45
+
44
46
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
47
 
46
48
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -276,9 +278,15 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
276
278
  var milliSec = currentDate.getMilliseconds();
277
279
 
278
280
  if (isDateTimeField || customDateFormat) {
279
- selectedInMillis = _datetimejs["default"].tz.tzToUtc(Date.UTC(year, month, date, hours, mins, sec, milliSec), timeZone);
281
+ var dateArgs = [year, month, date, hours, mins];
282
+
283
+ if (customDateFormat) {
284
+ dateArgs.push(sec, milliSec);
285
+ }
286
+
287
+ selectedInMillis = _datetimejs["default"].tz.tzToUtc(Date.UTC.apply(Date, dateArgs), timeZone);
280
288
  selectedValue = _datetimejs["default"].ISO(selectedInMillis);
281
- formattedValue = (0, _common.formatDate)(new Date(year, month, date, hours, mins, sec, milliSec), customDateFormat == null ? is24Hour ? "".concat(dateFormat, " HH:mm:ss") : "".concat(dateFormat, " hh:mm:ss A") : "".concat(customDateFormat));
289
+ formattedValue = (0, _common.formatDate)(_construct(Date, dateArgs), customDateFormat == null ? is24Hour ? "".concat(dateFormat, " HH:mm:ss") : "".concat(dateFormat, " hh:mm:ss A") : "".concat(customDateFormat));
282
290
  } else {
283
291
  selectedInMillis = Date.UTC(year, month, date);
284
292
  selectedValue = (0, _common.formatDate)(new Date(year, month, date), 'YYYY-MM-DD');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-alpha-274",
3
+ "version": "1.0.0-alpha-275",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -51,12 +51,12 @@
51
51
  "variable:check": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableErrorCheck.js ./src ./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
52
52
  },
53
53
  "devDependencies": {
54
- "@zohodesk-private/css-variable-migrator": "^1.0.1",
54
+ "@zohodesk-private/css-variable-migrator": "^1.0.5",
55
55
  "@zohodesk/a11y": "1.3.7",
56
56
  "@zohodesk-private/node-plugins": "^1.0.0",
57
57
  "@zohodesk/docstool": "1.0.0-alpha-2",
58
- "@zohodesk/icons": "1.0.0-beta.125",
59
- "@zohodesk/svg": "1.0.0-beta.56",
58
+ "@zohodesk/icons": "1.0.0-beta.132",
59
+ "@zohodesk/svg": "1.0.0-beta.59",
60
60
  "@zohodesk/variables": "1.0.0-beta.31",
61
61
  "@zohodesk/virtualizer": "1.0.3",
62
62
  "react-sortable-hoc": "^0.8.3",
@@ -69,9 +69,9 @@
69
69
  "selectn": "1.1.2"
70
70
  },
71
71
  "peerDependencies": {
72
- "@zohodesk/icons": "1.0.0-beta.125",
72
+ "@zohodesk/icons": "1.0.0-beta.132",
73
73
  "@zohodesk/variables": "1.0.0-beta.31",
74
- "@zohodesk/svg": "1.0.0-beta.56",
74
+ "@zohodesk/svg": "1.0.0-beta.59",
75
75
  "@zohodesk/virtualizer": "1.0.3",
76
76
  "velocity-react": "1.4.3",
77
77
  "react-sortable-hoc": "^0.8.3",