@artemy-tech/datepicker 0.6.1 → 0.7.1

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/rhf.cjs CHANGED
@@ -118,34 +118,137 @@ function Spinner() {
118
118
 
119
119
  // src/utils/date-mask.ts
120
120
  var import_date_fns = require("date-fns");
121
- var DATE_FORMAT = "dd.MM.yyyy";
122
- function resolveTimeFormat(showTime) {
123
- if (!showTime) return null;
124
- if (showTime === true) return "HH:mm:ss";
125
- return showTime.format;
121
+
122
+ // src/utils/format-schema.ts
123
+ var DATE_TOKENS = ["yyyy", "dd", "MM"];
124
+ var TIME_TOKENS = ["HH", "mm", "ss"];
125
+ var ALL_TOKENS = [...DATE_TOKENS, ...TIME_TOKENS];
126
+ var TOKEN_LENGTH = {
127
+ yyyy: 4,
128
+ dd: 2,
129
+ MM: 2,
130
+ HH: 2,
131
+ mm: 2,
132
+ ss: 2
133
+ };
134
+ var RU_TOKEN_PLACEHOLDER = {
135
+ yyyy: "\u0433\u0433\u0433\u0433",
136
+ dd: "\u0434\u0434",
137
+ MM: "\u043C\u043C",
138
+ HH: "\u0447\u0447",
139
+ mm: "\u043C\u043C",
140
+ ss: "\u0441\u0441"
141
+ };
142
+ var EN_TOKEN_PLACEHOLDER = {
143
+ yyyy: "yyyy",
144
+ dd: "dd",
145
+ MM: "mm",
146
+ HH: "hh",
147
+ mm: "mm",
148
+ ss: "ss"
149
+ };
150
+ function tokenize(format4, allowTime) {
151
+ const parts = [];
152
+ let i = 0;
153
+ while (i < format4.length) {
154
+ let matched = null;
155
+ for (const token of ALL_TOKENS) {
156
+ if (format4.startsWith(token, i)) {
157
+ matched = token;
158
+ break;
159
+ }
160
+ }
161
+ if (matched) {
162
+ if (!allowTime && TIME_TOKENS.includes(matched)) {
163
+ throw new Error(
164
+ `dateFormat must not contain time tokens (got "${matched}"). Use the "showTime" prop instead.`
165
+ );
166
+ }
167
+ parts.push({ kind: "token", token: matched });
168
+ i += matched.length;
169
+ continue;
170
+ }
171
+ parts.push({ kind: "sep", char: format4[i] });
172
+ i++;
173
+ }
174
+ return parts;
175
+ }
176
+ function validateDateParts(parts) {
177
+ var _a, _b;
178
+ const counts = {};
179
+ for (const p of parts) {
180
+ if (p.kind === "token") counts[p.token] = ((_a = counts[p.token]) != null ? _a : 0) + 1;
181
+ }
182
+ for (const token of DATE_TOKENS) {
183
+ if (counts[token] !== 1) {
184
+ throw new Error(
185
+ `dateFormat must contain "${token}" exactly once. Supported tokens: dd, MM, yyyy. Got: ${(_b = counts[token]) != null ? _b : 0}`
186
+ );
187
+ }
188
+ }
126
189
  }
127
- function buildDateFormat(timeFormat) {
128
- return timeFormat ? `${DATE_FORMAT} ${timeFormat}` : DATE_FORMAT;
190
+ function buildSchemaFromParts(parts, isRu) {
191
+ const placeholderMap = isRu ? RU_TOKEN_PLACEHOLDER : EN_TOKEN_PLACEHOLDER;
192
+ const separators = [];
193
+ let digitCount = 0;
194
+ let format4 = "";
195
+ let placeholder = "";
196
+ let pendingSep = "";
197
+ for (const part of parts) {
198
+ if (part.kind === "sep") {
199
+ pendingSep += part.char;
200
+ format4 += part.char;
201
+ placeholder += part.char;
202
+ continue;
203
+ }
204
+ if (pendingSep) {
205
+ separators.push({ afterDigit: digitCount, chars: pendingSep });
206
+ pendingSep = "";
207
+ }
208
+ digitCount += TOKEN_LENGTH[part.token];
209
+ format4 += part.token;
210
+ placeholder += placeholderMap[part.token];
211
+ }
212
+ return { format: format4, digitCount, separators, placeholder };
129
213
  }
130
- function buildMaxDigits(timeFormat) {
131
- if (!timeFormat) return 8;
132
- return timeFormat === "HH:mm" ? 12 : 14;
214
+ function isRuLocale(locale) {
215
+ if (!locale) return true;
216
+ return locale.code === "ru";
133
217
  }
134
- function buildPlaceholder(timeFormat) {
135
- if (!timeFormat) return "\u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433";
136
- return timeFormat === "HH:mm" ? "\u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433 \u0447\u0447:\u043C\u043C" : "\u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433 \u0447\u0447:\u043C\u043C:\u0441\u0441";
218
+ function buildFormatSchema(dateFormat, timeFormat, locale) {
219
+ const dateParts = tokenize(dateFormat, false);
220
+ validateDateParts(dateParts);
221
+ const parts = [...dateParts];
222
+ if (timeFormat) {
223
+ parts.push({ kind: "sep", char: " " });
224
+ parts.push(...tokenize(timeFormat, true));
225
+ }
226
+ return buildSchemaFromParts(parts, isRuLocale(locale));
137
227
  }
138
- function applyMask(digits, maxDigits) {
139
- const d = digits.slice(0, maxDigits);
228
+ function applySchemaMask(digits, schema) {
229
+ const d = digits.slice(0, schema.digitCount);
140
230
  let result = "";
231
+ let sepIdx = 0;
141
232
  for (let i = 0; i < d.length; i++) {
142
- if (i === 2 || i === 4) result += ".";
143
- else if (i === 8) result += " ";
144
- else if (i === 10 || i === 12) result += ":";
233
+ while (sepIdx < schema.separators.length && schema.separators[sepIdx].afterDigit === i) {
234
+ result += schema.separators[sepIdx].chars;
235
+ sepIdx++;
236
+ }
145
237
  result += d[i];
146
238
  }
147
239
  return result;
148
240
  }
241
+
242
+ // src/utils/date-mask.ts
243
+ var DEFAULT_DATE_FORMAT = "dd.MM.yyyy";
244
+ function resolveTimeFormat(showTime) {
245
+ if (!showTime) return null;
246
+ if (showTime === true) return "HH:mm:ss";
247
+ return showTime.format;
248
+ }
249
+ function applyMask(digits, schema) {
250
+ return applySchemaMask(digits, schema);
251
+ }
149
252
  function getCursorPos(masked, digitCount) {
150
253
  if (digitCount === 0) return 0;
151
254
  let count = 0;
@@ -160,11 +263,11 @@ function getCursorPos(masked, digitCount) {
160
263
  function toDateOnly(date) {
161
264
  return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0);
162
265
  }
163
- function parseDateTime(masked, dateFormat, maxDigits) {
164
- if (masked.replace(/\D/g, "").length !== maxDigits) return void 0;
165
- const date = (0, import_date_fns.parse)(masked, dateFormat, /* @__PURE__ */ new Date());
166
- if (!(0, import_date_fns.isValid)(date) || (0, import_date_fns.format)(date, dateFormat) !== masked) return void 0;
167
- return maxDigits === 8 ? toDateOnly(date) : date;
266
+ function parseDateTime(masked, schema) {
267
+ if (masked.replace(/\D/g, "").length !== schema.digitCount) return void 0;
268
+ const date = (0, import_date_fns.parse)(masked, schema.format, /* @__PURE__ */ new Date());
269
+ if (!(0, import_date_fns.isValid)(date) || (0, import_date_fns.format)(date, schema.format) !== masked) return void 0;
270
+ return schema.digitCount === 8 ? toDateOnly(date) : date;
168
271
  }
169
272
 
170
273
  // src/components/DatePicker/DatePicker.tsx
@@ -187,12 +290,18 @@ function DatePicker({
187
290
  iconPosition = "end",
188
291
  className,
189
292
  renderInput,
190
- customTrigger
293
+ customTrigger,
294
+ locale = import_locale.ru,
295
+ dateFormat: dateFormatProp = DEFAULT_DATE_FORMAT
191
296
  }) {
192
297
  const timeFormat = resolveTimeFormat(showTime);
193
- const dateFormat = buildDateFormat(timeFormat);
194
- const maxDigits = buildMaxDigits(timeFormat);
195
- const defaultPlaceholder = placeholder != null ? placeholder : buildPlaceholder(timeFormat);
298
+ const schema = (0, import_react3.useMemo)(
299
+ () => buildFormatSchema(dateFormatProp, timeFormat, locale),
300
+ [dateFormatProp, timeFormat, locale]
301
+ );
302
+ const dateFormat = schema.format;
303
+ const maxDigits = schema.digitCount;
304
+ const defaultPlaceholder = placeholder != null ? placeholder : schema.placeholder;
196
305
  const showSeconds = timeFormat === "HH:mm:ss";
197
306
  const fromDay = fromDate ? (0, import_date_fns2.startOfDay)(fromDate) : void 0;
198
307
  const toDay = toDate ? (0, import_date_fns2.startOfDay)(toDate) : void 0;
@@ -256,7 +365,7 @@ function DatePicker({
256
365
  if (!isControlled) setInternalDate(void 0);
257
366
  onChange == null ? void 0 : onChange(void 0);
258
367
  } else if (digits.length === maxDigits) {
259
- const date = parseDateTime(masked, dateFormat, maxDigits);
368
+ const date = parseDateTime(masked, schema);
260
369
  lastEmittedRef.current = date;
261
370
  if (date) lastValidRef.current = masked;
262
371
  setInputInvalid(!date);
@@ -280,7 +389,7 @@ function DatePicker({
280
389
  const cursorPos = (_a = input.selectionStart) != null ? _a : 0;
281
390
  const raw = input.value;
282
391
  const digits = raw.replace(/\D/g, "").slice(0, maxDigits);
283
- const masked = applyMask(digits, maxDigits);
392
+ const masked = applyMask(digits, schema);
284
393
  const digitsBeforeCursor = raw.slice(0, cursorPos).replace(/\D/g, "").length;
285
394
  const newCursorPos = getCursorPos(masked, digitsBeforeCursor);
286
395
  setInputValue(masked);
@@ -298,10 +407,14 @@ function DatePicker({
298
407
  e.preventDefault();
299
408
  return;
300
409
  }
301
- if (e.key === "Backspace" && pos > 0 && /[.: ]/.test(input.value[pos - 1])) {
410
+ const separatorChars = /* @__PURE__ */ new Set();
411
+ schema.separators.forEach((s) => {
412
+ for (const ch of s.chars) separatorChars.add(ch);
413
+ });
414
+ if (e.key === "Backspace" && pos > 0 && separatorChars.has(input.value[pos - 1])) {
302
415
  e.preventDefault();
303
416
  const val = input.value;
304
- const masked = applyMask((val.slice(0, pos - 2) + val.slice(pos)).replace(/\D/g, ""), maxDigits);
417
+ const masked = applyMask((val.slice(0, pos - 2) + val.slice(pos)).replace(/\D/g, ""), schema);
305
418
  setInputValue(masked);
306
419
  commit(masked);
307
420
  requestAnimationFrame(() => input.setSelectionRange(pos - 2, pos - 2));
@@ -309,7 +422,7 @@ function DatePicker({
309
422
  }
310
423
  function handlePaste(e) {
311
424
  e.preventDefault();
312
- const masked = applyMask(e.clipboardData.getData("text").replace(/\D/g, ""), maxDigits);
425
+ const masked = applyMask(e.clipboardData.getData("text").replace(/\D/g, ""), schema);
313
426
  setInputValue(masked);
314
427
  commit(masked);
315
428
  requestAnimationFrame(() => {
@@ -423,7 +536,7 @@ function DatePicker({
423
536
  endMonth: toDay,
424
537
  disabled: disabledDays.length ? disabledDays : void 0,
425
538
  navLayout: "around",
426
- locale: import_locale.ru
539
+ locale
427
540
  }
428
541
  ) }),
429
542
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "datepicker__time-separator" }),
@@ -457,7 +570,7 @@ function DatePicker({
457
570
  endMonth: toDay,
458
571
  disabled: disabledDays.length ? disabledDays : void 0,
459
572
  navLayout: "around",
460
- locale: import_locale.ru
573
+ locale
461
574
  }
462
575
  )
463
576
  }
@@ -495,22 +608,16 @@ var import_locale2 = require("date-fns/locale");
495
608
 
496
609
  // src/utils/range-mask.ts
497
610
  var import_date_fns3 = require("date-fns");
498
- var DATE_FORMAT2 = "dd.MM.yyyy";
499
- function applyDateMask(digits) {
500
- const d = digits.slice(0, 8);
501
- let result = "";
502
- for (let i = 0; i < d.length; i++) {
503
- if (i === 2 || i === 4) result += ".";
504
- result += d[i];
505
- }
506
- return result;
611
+ function applyDateMask(digits, schema) {
612
+ return applySchemaMask(digits, schema);
507
613
  }
508
- function applyRangeMask(digits) {
509
- const all = digits.slice(0, 16);
510
- const fromMasked = applyDateMask(all.slice(0, 8));
511
- const toDigits = all.slice(8);
614
+ function applyRangeMask(digits, schema) {
615
+ const total = schema.digitCount * 2;
616
+ const all = digits.slice(0, total);
617
+ const fromMasked = applyDateMask(all.slice(0, schema.digitCount), schema);
618
+ const toDigits = all.slice(schema.digitCount);
512
619
  if (toDigits.length === 0) return fromMasked;
513
- return `${fromMasked} \u2014 ${applyDateMask(toDigits)}`;
620
+ return `${fromMasked} \u2014 ${applyDateMask(toDigits, schema)}`;
514
621
  }
515
622
  function getRangeCursorPos(masked, digitCount) {
516
623
  if (digitCount === 0) return 0;
@@ -526,17 +633,17 @@ function getRangeCursorPos(masked, digitCount) {
526
633
  function toDateOnly2(date) {
527
634
  return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0);
528
635
  }
529
- function parseDate(masked) {
530
- if (masked.replace(/\D/g, "").length !== 8) return void 0;
531
- const date = (0, import_date_fns3.parse)(masked, DATE_FORMAT2, /* @__PURE__ */ new Date());
532
- if (!(0, import_date_fns3.isValid)(date) || (0, import_date_fns3.format)(date, DATE_FORMAT2) !== masked) return void 0;
636
+ function parseDate(masked, schema) {
637
+ if (masked.replace(/\D/g, "").length !== schema.digitCount) return void 0;
638
+ const date = (0, import_date_fns3.parse)(masked, schema.format, /* @__PURE__ */ new Date());
639
+ if (!(0, import_date_fns3.isValid)(date) || (0, import_date_fns3.format)(date, schema.format) !== masked) return void 0;
533
640
  return toDateOnly2(date);
534
641
  }
535
- function formatRange(from, to) {
642
+ function formatRange(from, to, schema) {
536
643
  if (!from) return "";
537
- const fromStr = (0, import_date_fns3.format)(from, DATE_FORMAT2);
644
+ const fromStr = (0, import_date_fns3.format)(from, schema.format);
538
645
  if (!to) return fromStr;
539
- return `${fromStr} \u2014 ${(0, import_date_fns3.format)(to, DATE_FORMAT2)}`;
646
+ return `${fromStr} \u2014 ${(0, import_date_fns3.format)(to, schema.format)}`;
540
647
  }
541
648
  function resolveShowSeconds(showTime) {
542
649
  if (!showTime) return false;
@@ -561,8 +668,16 @@ function DateRangePicker({
561
668
  showTime,
562
669
  icon,
563
670
  iconPosition = "end",
564
- className
671
+ className,
672
+ locale = import_locale2.ru,
673
+ dateFormat: dateFormatProp = DEFAULT_DATE_FORMAT
565
674
  }) {
675
+ const schema = (0, import_react4.useMemo)(
676
+ () => buildFormatSchema(dateFormatProp, null, locale),
677
+ [dateFormatProp, locale]
678
+ );
679
+ const maxDigits = schema.digitCount;
680
+ const totalDigits = maxDigits * 2;
566
681
  const resolvedIcon = loading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Spinner, {}) : icon === false ? null : icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CalendarIcon, {});
567
682
  const isControlled = value !== void 0;
568
683
  const showSeconds = resolveShowSeconds(showTime);
@@ -580,7 +695,7 @@ function DateRangePicker({
580
695
  );
581
696
  const [inputValue, setInputValue] = (0, import_react4.useState)(() => {
582
697
  const initial = value != null ? value : defaultValue;
583
- return formatRange(initial == null ? void 0 : initial.from, initial == null ? void 0 : initial.to);
698
+ return formatRange(initial == null ? void 0 : initial.from, initial == null ? void 0 : initial.to, schema);
584
699
  });
585
700
  const [inputInvalid, setInputInvalid] = (0, import_react4.useState)(false);
586
701
  const [open, setOpen] = (0, import_react4.useState)(false);
@@ -624,7 +739,7 @@ function DateRangePicker({
624
739
  const lastToTime = (_f = (_e = lastEmittedToRef.current) == null ? void 0 : _e.getTime()) != null ? _f : null;
625
740
  if (fromTime === lastFromTime && toTime === lastToTime) return;
626
741
  if (!wasControlledRef.current && value === void 0) return;
627
- setInputValue(formatRange(newFrom, newTo));
742
+ setInputValue(formatRange(newFrom, newTo, schema));
628
743
  setInputInvalid(false);
629
744
  if (!isControlled) {
630
745
  setInternalFrom(newFrom);
@@ -652,7 +767,7 @@ function DateRangePicker({
652
767
  setInternalFrom(from);
653
768
  setInternalTo(void 0);
654
769
  }
655
- setInputValue(formatRange(from, void 0));
770
+ setInputValue(formatRange(from, void 0, schema));
656
771
  setInputInvalid(false);
657
772
  lastEmittedFromRef.current = from;
658
773
  lastEmittedToRef.current = void 0;
@@ -675,7 +790,7 @@ function DateRangePicker({
675
790
  setInternalFrom(from);
676
791
  setInternalTo(to);
677
792
  }
678
- setInputValue(formatRange(from, to));
793
+ setInputValue(formatRange(from, to, schema));
679
794
  setInputInvalid(false);
680
795
  lastEmittedFromRef.current = from;
681
796
  lastEmittedToRef.current = to;
@@ -720,18 +835,18 @@ function DateRangePicker({
720
835
  const input = e.target;
721
836
  const cursorPos = (_a = input.selectionStart) != null ? _a : 0;
722
837
  const raw = input.value;
723
- const digits = raw.replace(/\D/g, "").slice(0, 16);
724
- const masked = applyRangeMask(digits);
838
+ const digits = raw.replace(/\D/g, "").slice(0, totalDigits);
839
+ const masked = applyRangeMask(digits, schema);
725
840
  const digitsBeforeCursor = raw.slice(0, cursorPos).replace(/\D/g, "").length;
726
841
  setInputValue(masked);
727
842
  setAnchorDate(void 0);
728
843
  setHoveredDate(void 0);
729
- const fromDigits = digits.slice(0, 8);
730
- const toDigits = digits.slice(8);
731
- const parsedFrom = fromDigits.length === 8 ? parseDate(applyDateMask(fromDigits)) : void 0;
732
- const parsedTo = toDigits.length === 8 ? parseDate(applyDateMask(toDigits)) : void 0;
733
- const fromComplete = fromDigits.length === 8;
734
- const toComplete = toDigits.length === 8;
844
+ const fromDigits = digits.slice(0, maxDigits);
845
+ const toDigits = digits.slice(maxDigits);
846
+ const parsedFrom = fromDigits.length === maxDigits ? parseDate(applyDateMask(fromDigits, schema), schema) : void 0;
847
+ const parsedTo = toDigits.length === maxDigits ? parseDate(applyDateMask(toDigits, schema), schema) : void 0;
848
+ const fromComplete = fromDigits.length === maxDigits;
849
+ const toComplete = toDigits.length === maxDigits;
735
850
  setInputInvalid(fromComplete && !parsedFrom || toComplete && !parsedTo);
736
851
  if (!isControlled) {
737
852
  setInternalFrom(parsedFrom);
@@ -760,13 +875,18 @@ function DateRangePicker({
760
875
  e.preventDefault();
761
876
  return;
762
877
  }
763
- if (e.key === "Backspace" && pos > 0 && /[\s—]/.test(input.value[pos - 1])) {
878
+ const separatorChars = /* @__PURE__ */ new Set([" ", "\u2014"]);
879
+ schema.separators.forEach((s) => {
880
+ for (const ch of s.chars) separatorChars.add(ch);
881
+ });
882
+ if (e.key === "Backspace" && pos > 0 && separatorChars.has(input.value[pos - 1])) {
764
883
  e.preventDefault();
765
884
  const val = input.value;
766
885
  const charsToSkip = (_c = (_b = val.slice(0, pos).match(/[\s—]+$/)) == null ? void 0 : _b[0].length) != null ? _c : 1;
767
886
  const newPos = pos - charsToSkip;
768
887
  const masked = applyRangeMask(
769
- (val.slice(0, newPos - 1) + val.slice(newPos)).replace(/\D/g, "")
888
+ (val.slice(0, newPos - 1) + val.slice(newPos)).replace(/\D/g, ""),
889
+ schema
770
890
  );
771
891
  setInputValue(masked);
772
892
  requestAnimationFrame(
@@ -777,15 +897,18 @@ function DateRangePicker({
777
897
  function handlePaste(e) {
778
898
  e.preventDefault();
779
899
  const text = e.clipboardData.getData("text");
780
- const digits = text.replace(/\D/g, "").slice(0, 16);
781
- const masked = applyRangeMask(digits);
900
+ const digits = text.replace(/\D/g, "").slice(0, totalDigits);
901
+ const masked = applyRangeMask(digits, schema);
782
902
  setInputValue(masked);
783
903
  setAnchorDate(void 0);
784
904
  setHoveredDate(void 0);
785
- const parsedFrom = digits.length >= 8 ? parseDate(applyDateMask(digits.slice(0, 8))) : void 0;
786
- const parsedTo = digits.length >= 16 ? parseDate(applyDateMask(digits.slice(8, 16))) : void 0;
905
+ const parsedFrom = digits.length >= maxDigits ? parseDate(applyDateMask(digits.slice(0, maxDigits), schema), schema) : void 0;
906
+ const parsedTo = digits.length >= totalDigits ? parseDate(
907
+ applyDateMask(digits.slice(maxDigits, totalDigits), schema),
908
+ schema
909
+ ) : void 0;
787
910
  setInputInvalid(
788
- digits.length >= 8 && !parsedFrom || digits.length >= 16 && !parsedTo
911
+ digits.length >= maxDigits && !parsedFrom || digits.length >= totalDigits && !parsedTo
789
912
  );
790
913
  if (!isControlled) {
791
914
  setInternalFrom(parsedFrom);
@@ -803,7 +926,7 @@ function DateRangePicker({
803
926
  }
804
927
  );
805
928
  }
806
- const placeholder = label && !focused && !filled ? void 0 : "\u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433 \u2014 \u0434\u0434.\u043C\u043C.\u0433\u0433\u0433\u0433";
929
+ const placeholder = label && !focused && !filled ? void 0 : `${schema.placeholder} \u2014 ${schema.placeholder}`;
807
930
  const interactive = !disabled && !loading;
808
931
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
809
932
  "div",
@@ -889,7 +1012,7 @@ function DateRangePicker({
889
1012
  endMonth: toDay,
890
1013
  disabled: disabledDays.length ? disabledDays : void 0,
891
1014
  numberOfMonths: 2,
892
- locale: import_locale2.ru
1015
+ locale
893
1016
  }
894
1017
  ) }) }),
895
1018
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "datepicker__time-row", children: [
@@ -941,7 +1064,7 @@ function DateRangePicker({
941
1064
  startMonth: fromConstraint,
942
1065
  endMonth: toConstraint,
943
1066
  numberOfMonths: 2,
944
- locale: import_locale2.ru
1067
+ locale
945
1068
  }
946
1069
  )
947
1070
  }