@hipay/hipay-material-ui 2.3.1 → 2.3.3

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 (41) hide show
  1. package/HiCell/CellDate.js +2 -4
  2. package/HiDatePicker/HiDatePicker.js +3 -4
  3. package/HiDatePicker/HiDateRangePicker.js +34 -38
  4. package/HiDatePicker/HiDateRangeSelector.js +24 -43
  5. package/HiIcon/HiIcon.js +6 -2
  6. package/es/HiCell/CellDate.js +2 -4
  7. package/es/HiDatePicker/HiDatePicker.js +3 -4
  8. package/es/HiDatePicker/HiDateRangePicker.js +34 -38
  9. package/es/HiDatePicker/HiDateRangeSelector.js +24 -43
  10. package/es/HiIcon/HiIcon.js +6 -2
  11. package/es/hi-svg-icons/HiAccount.js +3 -2
  12. package/es/hi-svg-icons/HiActivity.js +3 -2
  13. package/es/hi-svg-icons/HiAll.js +3 -2
  14. package/es/hi-svg-icons/HiBilling.js +3 -2
  15. package/es/hi-svg-icons/HiBriefcaseRescue.js +3 -2
  16. package/es/hi-svg-icons/HiCatalog.js +3 -2
  17. package/es/hi-svg-icons/HiCustomer.js +3 -2
  18. package/es/hi-svg-icons/HiDownload.js +12 -4
  19. package/es/hi-svg-icons/HiFinance.js +3 -2
  20. package/es/hi-svg-icons/HiPermission.js +3 -2
  21. package/es/hi-svg-icons/HiRoute.js +3 -2
  22. package/es/hi-svg-icons/HiSettlement.js +3 -2
  23. package/es/hi-svg-icons/HiTransaction.js +3 -2
  24. package/es/hi-svg-icons/HiUser.js +3 -2
  25. package/es/hi-svg-icons/HiWidget.js +3 -2
  26. package/hi-svg-icons/HiAccount.js +3 -2
  27. package/hi-svg-icons/HiActivity.js +3 -2
  28. package/hi-svg-icons/HiAll.js +3 -2
  29. package/hi-svg-icons/HiBilling.js +3 -2
  30. package/hi-svg-icons/HiBriefcaseRescue.js +3 -2
  31. package/hi-svg-icons/HiCatalog.js +3 -2
  32. package/hi-svg-icons/HiCustomer.js +3 -2
  33. package/hi-svg-icons/HiDownload.js +12 -4
  34. package/hi-svg-icons/HiFinance.js +3 -2
  35. package/hi-svg-icons/HiPermission.js +3 -2
  36. package/hi-svg-icons/HiRoute.js +3 -2
  37. package/hi-svg-icons/HiSettlement.js +3 -2
  38. package/hi-svg-icons/HiTransaction.js +3 -2
  39. package/hi-svg-icons/HiUser.js +3 -2
  40. package/hi-svg-icons/HiWidget.js +3 -2
  41. package/package.json +5 -4
@@ -19,9 +19,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inhe
19
19
 
20
20
  var _react = _interopRequireDefault(require("react"));
21
21
 
22
- var _moment = _interopRequireDefault(require("moment"));
23
-
24
- require("moment/locale/fr");
22
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
25
23
 
26
24
  var _styles = require("@material-ui/core/styles");
27
25
 
@@ -72,7 +70,7 @@ function (_React$PureComponent) {
72
70
  view = _this$props.view,
73
71
  formatShort = _this$props.formatShort;
74
72
  if (!date) return '';
75
- var mdate = (0, _moment.default)(date);
73
+ var mdate = (0, _momentTimezone.default)(date);
76
74
  mdate.locale(locale);
77
75
  var label;
78
76
 
@@ -87,7 +87,7 @@ function (_React$Component) {
87
87
  };
88
88
 
89
89
  _this.handleReset = function () {
90
- var today = (0, _momentTimezone.default)().tz(_this.props.timezoneName);
90
+ var today = (0, _momentTimezone.default)();
91
91
 
92
92
  _this.handleCurrentMonthChange(new Date(today.year(), today.month(), today.date(), today.hours(), today.minutes(), today.seconds(), today.milliseconds()));
93
93
 
@@ -227,7 +227,7 @@ function (_React$Component) {
227
227
  }, yearPickerProps, propsOverlay));
228
228
  };
229
229
 
230
- var _today = (0, _momentTimezone.default)().tz(props.timezoneName);
230
+ var _today = (0, _momentTimezone.default)();
231
231
 
232
232
  _this.state = {
233
233
  openedPanel: 'calendar',
@@ -261,7 +261,7 @@ function (_React$Component) {
261
261
  hideOnDayClick = _this$props.hideOnDayClick,
262
262
  props = (0, _objectWithoutProperties2.default)(_this$props, ["classes", "disabledDays", "disablePastDays", "disableFutureDays", "enableTime", "format", "locale", "minimumDate", "onReset", "translations", "value", "hideOnDayClick"]);
263
263
  var currentMonth = this.state.currentMonth;
264
- var today = (0, _momentTimezone.default)().tz(this.props.timezoneName);
264
+ var today = (0, _momentTimezone.default)();
265
265
  var effectiveDisabledDays = (0, _objectSpread2.default)({}, disablePastDays && {
266
266
  before: new Date(today.year(), today.month(), today.date(), today.hours(), today.minutes(), today.seconds(), today.milliseconds())
267
267
  }, {}, disableFutureDays && {
@@ -359,7 +359,6 @@ HiDatePicker.defaultProps = {
359
359
  locale: 'fr-FR',
360
360
  minimumDate: new Date(2013, 4, 1),
361
361
  // by default 1 May 2013
362
- timezoneName: 'Europe/Paris',
363
362
  translations: {
364
363
  today: 'today'
365
364
  }
@@ -110,7 +110,7 @@ function (_React$Component) {
110
110
 
111
111
  _this.onDayToClick = function (day) {
112
112
  var change = (0, _momentTimezone.default)(day) >= (0, _momentTimezone.default)(_this.props.from);
113
- var today = (0, _momentTimezone.default)().tz(_this.props.timezoneName);
113
+ var today = (0, _momentTimezone.default)();
114
114
  var todayDate = new Date(today.year(), today.month(), today.date(), 23, 59, 59);
115
115
 
116
116
  if (change && day > todayDate) {
@@ -143,17 +143,15 @@ function (_React$Component) {
143
143
  };
144
144
 
145
145
  _this.handleChange = function (name, day) {
146
- var _this$props = _this.props,
147
- translations = _this$props.translations,
148
- timezoneName = _this$props.timezoneName;
146
+ var translations = _this.props.translations;
149
147
  var date;
150
148
  var error;
151
- var today = (0, _momentTimezone.default)().tz(timezoneName);
149
+ var today = (0, _momentTimezone.default)();
152
150
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59);
153
- var _this$props2 = _this.props,
154
- minimumDate = _this$props2.minimumDate,
155
- disableFutureDays = _this$props2.disableFutureDays,
156
- format = _this$props2.format;
151
+ var _this$props = _this.props,
152
+ minimumDate = _this$props.minimumDate,
153
+ disableFutureDays = _this$props.disableFutureDays,
154
+ format = _this$props.format;
157
155
 
158
156
  if (day instanceof Date) {
159
157
  date = day;
@@ -175,7 +173,7 @@ function (_React$Component) {
175
173
  } else if ((0, _momentTimezone.default)(date).utc() < (0, _momentTimezone.default)(minimumDate).utc().startOf('day')) {
176
174
  error = translations.date_inferior_min_date.replace('%s', (0, _momentTimezone.default)(minimumDate).format(format));
177
175
  } else if (disableFutureDays && date > now) {
178
- error = translations.date_superior_max_date.replace('%s', (0, _momentTimezone.default)().tz(timezoneName).format(format));
176
+ error = translations.date_superior_max_date.replace('%s', (0, _momentTimezone.default)().format(format));
179
177
  }
180
178
 
181
179
  if (!_this.props.enableTime) {
@@ -369,7 +367,7 @@ function (_React$Component) {
369
367
  }, yearPickerProps, propsOverlay));
370
368
  };
371
369
 
372
- var _today = (0, _momentTimezone.default)().tz(_this.props.timezoneName);
370
+ var _today = (0, _momentTimezone.default)();
373
371
 
374
372
  _this.state = {
375
373
  currentMonth: new Date(_today.year(), _today.month(), _today.date()),
@@ -390,32 +388,31 @@ function (_React$Component) {
390
388
  var _this2 = this,
391
389
  _classNames;
392
390
 
393
- var _this$props3 = this.props,
394
- classes = _this$props3.classes,
395
- disabled = _this$props3.disabled,
396
- disabledDays = _this$props3.disabledDays,
397
- disableFutureDays = _this$props3.disableFutureDays,
398
- enableTime = _this$props3.enableTime,
399
- labelFrom = _this$props3.labelFrom,
400
- labelTo = _this$props3.labelTo,
401
- locale = _this$props3.locale,
402
- format = _this$props3.format,
403
- from = _this$props3.from,
404
- fromError = _this$props3.fromError,
405
- minimumDate = _this$props3.minimumDate,
406
- onReset = _this$props3.onReset,
407
- to = _this$props3.to,
408
- toError = _this$props3.toError,
409
- translations = _this$props3.translations,
410
- id = _this$props3.id,
411
- staticPosition = _this$props3.staticPosition,
412
- errorText = _this$props3.errorText,
413
- hasSelector = _this$props3.hasSelector,
414
- helperIcon = _this$props3.helperIcon,
415
- helperText = _this$props3.helperText,
416
- timezoneName = _this$props3.timezoneName,
417
- props = (0, _objectWithoutProperties2.default)(_this$props3, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperText", "timezoneName"]);
418
- var today = (0, _momentTimezone.default)().tz(timezoneName);
391
+ var _this$props2 = this.props,
392
+ classes = _this$props2.classes,
393
+ disabled = _this$props2.disabled,
394
+ disabledDays = _this$props2.disabledDays,
395
+ disableFutureDays = _this$props2.disableFutureDays,
396
+ enableTime = _this$props2.enableTime,
397
+ labelFrom = _this$props2.labelFrom,
398
+ labelTo = _this$props2.labelTo,
399
+ locale = _this$props2.locale,
400
+ format = _this$props2.format,
401
+ from = _this$props2.from,
402
+ fromError = _this$props2.fromError,
403
+ minimumDate = _this$props2.minimumDate,
404
+ onReset = _this$props2.onReset,
405
+ to = _this$props2.to,
406
+ toError = _this$props2.toError,
407
+ translations = _this$props2.translations,
408
+ id = _this$props2.id,
409
+ staticPosition = _this$props2.staticPosition,
410
+ errorText = _this$props2.errorText,
411
+ hasSelector = _this$props2.hasSelector,
412
+ helperIcon = _this$props2.helperIcon,
413
+ helperText = _this$props2.helperText,
414
+ props = (0, _objectWithoutProperties2.default)(_this$props2, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperText"]);
415
+ var today = (0, _momentTimezone.default)();
419
416
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59, 999);
420
417
  var modifiers = (0, _defineProperty2.default)({
421
418
  start: from,
@@ -636,7 +633,6 @@ HiDateRangePicker.defaultProps = {
636
633
  locale: 'fr-FR',
637
634
  minimumDate: new Date(2013, 4, 1),
638
635
  // by default 1 May 2013
639
- timezoneName: 'Europe/Paris',
640
636
  translations: {
641
637
  today: 'today',
642
638
  hour: 'Hour',
@@ -89,87 +89,81 @@ function yearAndQuarter(format, date, t) {
89
89
  return indexY < indexM ? date.format("".concat(split[indexY]).concat(s, "[").concat(t.short_quarter, "]Q")) : date.format("[".concat(t.short_quarter, "]Q").concat(s).concat(split[indexY]));
90
90
  }
91
91
 
92
- function buildDateRangeOptionByKey(key, t, format, timezoneName) {
92
+ function buildDateRangeOptionByKey(key, t, format) {
93
93
  var from;
94
94
  var label;
95
95
  var info;
96
96
  var to;
97
97
  var type;
98
98
 
99
- _momentTimezone.default.updateLocale('en', {
100
- week: {
101
- dow: 1
102
- }
103
- });
104
-
105
99
  switch (key) {
106
100
  case 'custom':
107
101
  label = t.custom_period;
108
- from = (0, _momentTimezone.default)().tz(timezoneName).subtract(15, 'day').startOf('day');
109
- to = (0, _momentTimezone.default)().tz(timezoneName).endOf('day');
102
+ from = (0, _momentTimezone.default)().subtract(15, 'day').startOf('day');
103
+ to = (0, _momentTimezone.default)().endOf('day');
110
104
  type = 'primary-highlight';
111
105
  break;
112
106
 
113
107
  case 'cd':
114
108
  label = t.today;
115
- from = (0, _momentTimezone.default)().tz(timezoneName).startOf('day');
116
- to = (0, _momentTimezone.default)().tz(timezoneName).endOf('day');
109
+ from = (0, _momentTimezone.default)().startOf('day');
110
+ to = (0, _momentTimezone.default)().endOf('day');
117
111
  info = "".concat(from.format(format));
118
112
  break;
119
113
 
120
114
  case 'pd':
121
115
  label = t.yesterday;
122
- from = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'day').startOf('day');
123
- to = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'day').endOf('day');
116
+ from = (0, _momentTimezone.default)().subtract(1, 'day').startOf('day');
117
+ to = (0, _momentTimezone.default)().subtract(1, 'day').endOf('day');
124
118
  info = "".concat(from.format(format));
125
119
  break;
126
120
 
127
121
  case 'cw':
128
122
  label = t.current_week;
129
- from = (0, _momentTimezone.default)().tz(timezoneName).startOf('week');
130
- to = (0, _momentTimezone.default)().tz(timezoneName);
123
+ from = (0, _momentTimezone.default)().startOf('week');
124
+ to = (0, _momentTimezone.default)();
131
125
  info = "".concat(t.short_week).concat(from.format('w'), ", \n ").concat(from.format(format), " ").concat(t.to_now);
132
126
  break;
133
127
 
134
128
  case 'pw':
135
129
  label = t.previous_week;
136
- from = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'week').startOf('week');
137
- to = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'week').endOf('week');
130
+ from = (0, _momentTimezone.default)().subtract(1, 'week').startOf('week');
131
+ to = (0, _momentTimezone.default)().subtract(1, 'week').endOf('week');
138
132
  info = "".concat(t.short_week).concat(from.format('w'), ", ").concat(from.format(format), " ").concat(t.to, " ").concat(to.format(format));
139
133
  break;
140
134
 
141
135
  case 'cm':
142
136
  label = t.current_month;
143
- from = (0, _momentTimezone.default)().tz(timezoneName).startOf('month');
144
- to = (0, _momentTimezone.default)().tz(timezoneName);
137
+ from = (0, _momentTimezone.default)().startOf('month');
138
+ to = (0, _momentTimezone.default)();
145
139
  info = "".concat(from.format(format), " ").concat(t.to_now, ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
146
140
  break;
147
141
 
148
142
  case 'pm':
149
143
  label = t.previous_month;
150
- from = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'month').startOf('month');
151
- to = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'month').endOf('month');
144
+ from = (0, _momentTimezone.default)().subtract(1, 'month').startOf('month');
145
+ to = (0, _momentTimezone.default)().subtract(1, 'month').endOf('month');
152
146
  info = "".concat(yearAndMonth(format, from), ", ").concat(from.daysInMonth(), " ").concat(t.days);
153
147
  break;
154
148
 
155
149
  case 'cq':
156
150
  label = t.current_quarter;
157
- from = (0, _momentTimezone.default)().tz(timezoneName).startOf('quarter');
158
- to = (0, _momentTimezone.default)().tz(timezoneName);
151
+ from = (0, _momentTimezone.default)().startOf('quarter');
152
+ to = (0, _momentTimezone.default)();
159
153
  info = "".concat(yearAndQuarter(format, from, t), ", ").concat(from.format(format), " ").concat(t.to_now, ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
160
154
  break;
161
155
 
162
156
  case 'pq':
163
157
  label = t.previous_quarter;
164
- from = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'quarter').startOf('quarter');
165
- to = (0, _momentTimezone.default)().tz(timezoneName).subtract(1, 'quarter').endOf('quarter');
158
+ from = (0, _momentTimezone.default)().subtract(1, 'quarter').startOf('quarter');
159
+ to = (0, _momentTimezone.default)().subtract(1, 'quarter').endOf('quarter');
166
160
  info = "".concat(yearAndQuarter(format, from, t), ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
167
161
  break;
168
162
 
169
163
  case 'cy':
170
164
  label = t.current_year;
171
- from = (0, _momentTimezone.default)().tz(timezoneName).startOf('year');
172
- to = (0, _momentTimezone.default)().tz(timezoneName);
165
+ from = (0, _momentTimezone.default)().startOf('year');
166
+ to = (0, _momentTimezone.default)();
173
167
  info = "".concat(from.format(format), " ").concat(t.to_now, ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
174
168
  break;
175
169
 
@@ -268,7 +262,7 @@ function (_React$Component) {
268
262
  };
269
263
 
270
264
  _this.options = props.availableOptionKeys.map(function (key) {
271
- return buildDateRangeOptionByKey(key, props.translations, props.format, props.timezoneName);
265
+ return buildDateRangeOptionByKey(key, props.translations, props.format);
272
266
  });
273
267
  _this.state = {
274
268
  selectedPreset: props.defaultPreset,
@@ -286,18 +280,6 @@ function (_React$Component) {
286
280
  });
287
281
  }
288
282
  }
289
- }, {
290
- key: "componentDidUpdate",
291
- value: function componentDidUpdate(prevProps) {
292
- var _this2 = this;
293
-
294
- if (prevProps.timezoneName !== this.props.timezoneName) {
295
- this.options = this.props.availableOptionKeys.map(function (key) {
296
- return buildDateRangeOptionByKey(key, _this2.props.translations, _this2.props.format, _this2.props.timezoneName);
297
- });
298
- this.updateDates(this.state.selectedPreset);
299
- }
300
- }
301
283
  }, {
302
284
  key: "componentWillUnmount",
303
285
  value: function componentWillUnmount() {
@@ -324,7 +306,7 @@ function (_React$Component) {
324
306
  }, {
325
307
  key: "render",
326
308
  value: function render() {
327
- var _this3 = this;
309
+ var _this2 = this;
328
310
 
329
311
  var _this$props = this.props,
330
312
  disabled = _this$props.disabled,
@@ -369,7 +351,7 @@ function (_React$Component) {
369
351
  flexDirection: 'column'
370
352
  } : {},
371
353
  ref: function ref(container) {
372
- _this3.container = container;
354
+ _this2.container = container;
373
355
  }
374
356
  }, _react.default.createElement("div", {
375
357
  className: classes.select,
@@ -444,7 +426,6 @@ HiDateRangeSelector.defaultProps = {
444
426
  format: 'YYYY-DD-MM',
445
427
  minimumDate: new Date(2013, 4, 1),
446
428
  // by default 1 May 2013
447
- timezoneName: 'Europe/Paris',
448
429
  translations: {
449
430
  today: 'Today',
450
431
  hour: 'Hour',
package/HiIcon/HiIcon.js CHANGED
@@ -46,7 +46,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
46
46
  });
47
47
  exports.useStyles = useStyles;
48
48
 
49
- function HiIcon(props) {
49
+ var HiIcon = _react.default.forwardRef(function (props, ref) {
50
50
  var children = props.children,
51
51
  className = props.className,
52
52
  icon = props.icon,
@@ -60,6 +60,7 @@ function HiIcon(props) {
60
60
 
61
61
  if (iconName && iconName.indexOf('fa-') === 0) {
62
62
  return _react.default.createElement("i", (0, _extends2.default)({
63
+ ref: ref,
63
64
  className: (0, _classnames.default)('fa', iconName, className, classes.root),
64
65
  style: {
65
66
  fontSize: size
@@ -71,6 +72,7 @@ function HiIcon(props) {
71
72
  if (iconName && iconName.indexOf('hi_') === 0) {
72
73
  var IconName = hiSvgIcons[(0, _helpers.capitalize)((0, _helpers.camelize)(iconName))];
73
74
  return _react.default.createElement(IconName, (0, _extends2.default)({
75
+ ref: ref,
74
76
  className: (0, _classnames.default)(classes.root, className),
75
77
  color: color,
76
78
  size: size
@@ -87,6 +89,7 @@ function HiIcon(props) {
87
89
  if (iconName && iconName.indexOf('mdi_') === 0) {
88
90
  var _IconName = mdi[(0, _helpers.capitalize)((0, _helpers.camelize)(iconName.slice(4)))];
89
91
  return _react.default.createElement(_IconName, (0, _extends2.default)({
92
+ ref: ref,
90
93
  className: (0, _classnames.default)(classes.root, className),
91
94
  color: color,
92
95
  style: {
@@ -97,13 +100,14 @@ function HiIcon(props) {
97
100
 
98
101
 
99
102
  return _react.default.createElement(_Icon.default, (0, _extends2.default)({
103
+ ref: ref,
100
104
  className: (0, _classnames.default)(classes.root, className),
101
105
  color: color,
102
106
  style: {
103
107
  fontSize: size
104
108
  }
105
109
  }, other), iconName);
106
- }
110
+ });
107
111
 
108
112
  HiIcon.defaultProps = {
109
113
  color: 'neutral',
@@ -19,9 +19,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inhe
19
19
 
20
20
  var _react = _interopRequireDefault(require("react"));
21
21
 
22
- var _moment = _interopRequireDefault(require("moment"));
23
-
24
- require("moment/locale/fr");
22
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
25
23
 
26
24
  var _styles = require("@material-ui/core/styles");
27
25
 
@@ -72,7 +70,7 @@ function (_React$PureComponent) {
72
70
  view = _this$props.view,
73
71
  formatShort = _this$props.formatShort;
74
72
  if (!date) return '';
75
- var mdate = (0, _moment.default)(date);
73
+ var mdate = (0, _momentTimezone.default)(date);
76
74
  mdate.locale(locale);
77
75
  var label;
78
76
 
@@ -87,7 +87,7 @@ function (_React$Component) {
87
87
  };
88
88
 
89
89
  _this.handleReset = function () {
90
- var today = (0, _momentTimezone.default)().tz(_this.props.timezoneName);
90
+ var today = (0, _momentTimezone.default)();
91
91
 
92
92
  _this.handleCurrentMonthChange(new Date(today.year(), today.month(), today.date(), today.hours(), today.minutes(), today.seconds(), today.milliseconds()));
93
93
 
@@ -227,7 +227,7 @@ function (_React$Component) {
227
227
  }, yearPickerProps, propsOverlay));
228
228
  };
229
229
 
230
- var _today = (0, _momentTimezone.default)().tz(props.timezoneName);
230
+ var _today = (0, _momentTimezone.default)();
231
231
 
232
232
  _this.state = {
233
233
  openedPanel: 'calendar',
@@ -261,7 +261,7 @@ function (_React$Component) {
261
261
  hideOnDayClick = _this$props.hideOnDayClick,
262
262
  props = (0, _objectWithoutProperties2.default)(_this$props, ["classes", "disabledDays", "disablePastDays", "disableFutureDays", "enableTime", "format", "locale", "minimumDate", "onReset", "translations", "value", "hideOnDayClick"]);
263
263
  var currentMonth = this.state.currentMonth;
264
- var today = (0, _momentTimezone.default)().tz(this.props.timezoneName);
264
+ var today = (0, _momentTimezone.default)();
265
265
  var effectiveDisabledDays = (0, _objectSpread2.default)({}, disablePastDays && {
266
266
  before: new Date(today.year(), today.month(), today.date(), today.hours(), today.minutes(), today.seconds(), today.milliseconds())
267
267
  }, {}, disableFutureDays && {
@@ -359,7 +359,6 @@ HiDatePicker.defaultProps = {
359
359
  locale: 'fr-FR',
360
360
  minimumDate: new Date(2013, 4, 1),
361
361
  // by default 1 May 2013
362
- timezoneName: 'Europe/Paris',
363
362
  translations: {
364
363
  today: 'today'
365
364
  }
@@ -110,7 +110,7 @@ function (_React$Component) {
110
110
 
111
111
  _this.onDayToClick = function (day) {
112
112
  var change = (0, _momentTimezone.default)(day) >= (0, _momentTimezone.default)(_this.props.from);
113
- var today = (0, _momentTimezone.default)().tz(_this.props.timezoneName);
113
+ var today = (0, _momentTimezone.default)();
114
114
  var todayDate = new Date(today.year(), today.month(), today.date(), 23, 59, 59);
115
115
 
116
116
  if (change && day > todayDate) {
@@ -143,17 +143,15 @@ function (_React$Component) {
143
143
  };
144
144
 
145
145
  _this.handleChange = function (name, day) {
146
- var _this$props = _this.props,
147
- translations = _this$props.translations,
148
- timezoneName = _this$props.timezoneName;
146
+ var translations = _this.props.translations;
149
147
  var date;
150
148
  var error;
151
- var today = (0, _momentTimezone.default)().tz(timezoneName);
149
+ var today = (0, _momentTimezone.default)();
152
150
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59);
153
- var _this$props2 = _this.props,
154
- minimumDate = _this$props2.minimumDate,
155
- disableFutureDays = _this$props2.disableFutureDays,
156
- format = _this$props2.format;
151
+ var _this$props = _this.props,
152
+ minimumDate = _this$props.minimumDate,
153
+ disableFutureDays = _this$props.disableFutureDays,
154
+ format = _this$props.format;
157
155
 
158
156
  if (day instanceof Date) {
159
157
  date = day;
@@ -175,7 +173,7 @@ function (_React$Component) {
175
173
  } else if ((0, _momentTimezone.default)(date).utc() < (0, _momentTimezone.default)(minimumDate).utc().startOf('day')) {
176
174
  error = translations.date_inferior_min_date.replace('%s', (0, _momentTimezone.default)(minimumDate).format(format));
177
175
  } else if (disableFutureDays && date > now) {
178
- error = translations.date_superior_max_date.replace('%s', (0, _momentTimezone.default)().tz(timezoneName).format(format));
176
+ error = translations.date_superior_max_date.replace('%s', (0, _momentTimezone.default)().format(format));
179
177
  }
180
178
 
181
179
  if (!_this.props.enableTime) {
@@ -369,7 +367,7 @@ function (_React$Component) {
369
367
  }, yearPickerProps, propsOverlay));
370
368
  };
371
369
 
372
- var _today = (0, _momentTimezone.default)().tz(_this.props.timezoneName);
370
+ var _today = (0, _momentTimezone.default)();
373
371
 
374
372
  _this.state = {
375
373
  currentMonth: new Date(_today.year(), _today.month(), _today.date()),
@@ -390,32 +388,31 @@ function (_React$Component) {
390
388
  var _this2 = this,
391
389
  _classNames;
392
390
 
393
- var _this$props3 = this.props,
394
- classes = _this$props3.classes,
395
- disabled = _this$props3.disabled,
396
- disabledDays = _this$props3.disabledDays,
397
- disableFutureDays = _this$props3.disableFutureDays,
398
- enableTime = _this$props3.enableTime,
399
- labelFrom = _this$props3.labelFrom,
400
- labelTo = _this$props3.labelTo,
401
- locale = _this$props3.locale,
402
- format = _this$props3.format,
403
- from = _this$props3.from,
404
- fromError = _this$props3.fromError,
405
- minimumDate = _this$props3.minimumDate,
406
- onReset = _this$props3.onReset,
407
- to = _this$props3.to,
408
- toError = _this$props3.toError,
409
- translations = _this$props3.translations,
410
- id = _this$props3.id,
411
- staticPosition = _this$props3.staticPosition,
412
- errorText = _this$props3.errorText,
413
- hasSelector = _this$props3.hasSelector,
414
- helperIcon = _this$props3.helperIcon,
415
- helperText = _this$props3.helperText,
416
- timezoneName = _this$props3.timezoneName,
417
- props = (0, _objectWithoutProperties2.default)(_this$props3, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperText", "timezoneName"]);
418
- var today = (0, _momentTimezone.default)().tz(timezoneName);
391
+ var _this$props2 = this.props,
392
+ classes = _this$props2.classes,
393
+ disabled = _this$props2.disabled,
394
+ disabledDays = _this$props2.disabledDays,
395
+ disableFutureDays = _this$props2.disableFutureDays,
396
+ enableTime = _this$props2.enableTime,
397
+ labelFrom = _this$props2.labelFrom,
398
+ labelTo = _this$props2.labelTo,
399
+ locale = _this$props2.locale,
400
+ format = _this$props2.format,
401
+ from = _this$props2.from,
402
+ fromError = _this$props2.fromError,
403
+ minimumDate = _this$props2.minimumDate,
404
+ onReset = _this$props2.onReset,
405
+ to = _this$props2.to,
406
+ toError = _this$props2.toError,
407
+ translations = _this$props2.translations,
408
+ id = _this$props2.id,
409
+ staticPosition = _this$props2.staticPosition,
410
+ errorText = _this$props2.errorText,
411
+ hasSelector = _this$props2.hasSelector,
412
+ helperIcon = _this$props2.helperIcon,
413
+ helperText = _this$props2.helperText,
414
+ props = (0, _objectWithoutProperties2.default)(_this$props2, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperText"]);
415
+ var today = (0, _momentTimezone.default)();
419
416
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59, 999);
420
417
  var modifiers = (0, _defineProperty2.default)({
421
418
  start: from,
@@ -636,7 +633,6 @@ HiDateRangePicker.defaultProps = {
636
633
  locale: 'fr-FR',
637
634
  minimumDate: new Date(2013, 4, 1),
638
635
  // by default 1 May 2013
639
- timezoneName: 'Europe/Paris',
640
636
  translations: {
641
637
  today: 'today',
642
638
  hour: 'Hour',