sanity-plugin-recurring-dates 1.0.3 → 1.1.0
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/LICENSE +1 -1
- package/README.md +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +319 -286
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +319 -286
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
- package/src/components/RecurringDate.tsx +21 -2
- package/src/schema/recurringDates.tsx +3 -3
- package/src/types.ts +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -161,20 +161,23 @@ var moment$1 = {
|
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
function isValid(m) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
var flags = null,
|
|
165
|
+
parsedParts = false,
|
|
166
|
+
isNowValid = m._d && !isNaN(m._d.getTime());
|
|
167
|
+
if (isNowValid) {
|
|
168
|
+
flags = getParsingFlags(m);
|
|
169
|
+
parsedParts = some.call(flags.parsedDateParts, function (i) {
|
|
170
|
+
return i != null;
|
|
171
|
+
});
|
|
172
|
+
isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
|
|
170
173
|
if (m._strict) {
|
|
171
174
|
isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
|
|
172
175
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
}
|
|
177
|
+
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
|
178
|
+
m._isValid = isNowValid;
|
|
179
|
+
} else {
|
|
180
|
+
return isNowValid;
|
|
178
181
|
}
|
|
179
182
|
return m._isValid;
|
|
180
183
|
}
|
|
@@ -526,11 +529,56 @@ var moment$1 = {
|
|
|
526
529
|
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
|
527
530
|
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
|
528
531
|
}
|
|
529
|
-
var aliases = {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
532
|
+
var aliases = {
|
|
533
|
+
D: 'date',
|
|
534
|
+
dates: 'date',
|
|
535
|
+
date: 'date',
|
|
536
|
+
d: 'day',
|
|
537
|
+
days: 'day',
|
|
538
|
+
day: 'day',
|
|
539
|
+
e: 'weekday',
|
|
540
|
+
weekdays: 'weekday',
|
|
541
|
+
weekday: 'weekday',
|
|
542
|
+
E: 'isoWeekday',
|
|
543
|
+
isoweekdays: 'isoWeekday',
|
|
544
|
+
isoweekday: 'isoWeekday',
|
|
545
|
+
DDD: 'dayOfYear',
|
|
546
|
+
dayofyears: 'dayOfYear',
|
|
547
|
+
dayofyear: 'dayOfYear',
|
|
548
|
+
h: 'hour',
|
|
549
|
+
hours: 'hour',
|
|
550
|
+
hour: 'hour',
|
|
551
|
+
ms: 'millisecond',
|
|
552
|
+
milliseconds: 'millisecond',
|
|
553
|
+
millisecond: 'millisecond',
|
|
554
|
+
m: 'minute',
|
|
555
|
+
minutes: 'minute',
|
|
556
|
+
minute: 'minute',
|
|
557
|
+
M: 'month',
|
|
558
|
+
months: 'month',
|
|
559
|
+
month: 'month',
|
|
560
|
+
Q: 'quarter',
|
|
561
|
+
quarters: 'quarter',
|
|
562
|
+
quarter: 'quarter',
|
|
563
|
+
s: 'second',
|
|
564
|
+
seconds: 'second',
|
|
565
|
+
second: 'second',
|
|
566
|
+
gg: 'weekYear',
|
|
567
|
+
weekyears: 'weekYear',
|
|
568
|
+
weekyear: 'weekYear',
|
|
569
|
+
GG: 'isoWeekYear',
|
|
570
|
+
isoweekyears: 'isoWeekYear',
|
|
571
|
+
isoweekyear: 'isoWeekYear',
|
|
572
|
+
w: 'week',
|
|
573
|
+
weeks: 'week',
|
|
574
|
+
week: 'week',
|
|
575
|
+
W: 'isoWeek',
|
|
576
|
+
isoweeks: 'isoWeek',
|
|
577
|
+
isoweek: 'isoWeek',
|
|
578
|
+
y: 'year',
|
|
579
|
+
years: 'year',
|
|
580
|
+
year: 'year'
|
|
581
|
+
};
|
|
534
582
|
function normalizeUnits(units) {
|
|
535
583
|
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
|
|
536
584
|
}
|
|
@@ -548,10 +596,24 @@ var moment$1 = {
|
|
|
548
596
|
}
|
|
549
597
|
return normalizedInput;
|
|
550
598
|
}
|
|
551
|
-
var priorities = {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
599
|
+
var priorities = {
|
|
600
|
+
date: 9,
|
|
601
|
+
day: 11,
|
|
602
|
+
weekday: 11,
|
|
603
|
+
isoWeekday: 11,
|
|
604
|
+
dayOfYear: 4,
|
|
605
|
+
hour: 13,
|
|
606
|
+
millisecond: 16,
|
|
607
|
+
minute: 14,
|
|
608
|
+
month: 8,
|
|
609
|
+
quarter: 7,
|
|
610
|
+
second: 15,
|
|
611
|
+
weekYear: 1,
|
|
612
|
+
isoWeekYear: 1,
|
|
613
|
+
week: 5,
|
|
614
|
+
isoWeek: 5,
|
|
615
|
+
year: 1
|
|
616
|
+
};
|
|
555
617
|
function getPrioritizedUnits(unitsObj) {
|
|
556
618
|
var units = [],
|
|
557
619
|
u;
|
|
@@ -568,76 +630,6 @@ var moment$1 = {
|
|
|
568
630
|
});
|
|
569
631
|
return units;
|
|
570
632
|
}
|
|
571
|
-
function isLeapYear(year) {
|
|
572
|
-
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
573
|
-
}
|
|
574
|
-
function absFloor(number) {
|
|
575
|
-
if (number < 0) {
|
|
576
|
-
// -0 -> 0
|
|
577
|
-
return Math.ceil(number) || 0;
|
|
578
|
-
} else {
|
|
579
|
-
return Math.floor(number);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
function toInt(argumentForCoercion) {
|
|
583
|
-
var coercedNumber = +argumentForCoercion,
|
|
584
|
-
value = 0;
|
|
585
|
-
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
|
586
|
-
value = absFloor(coercedNumber);
|
|
587
|
-
}
|
|
588
|
-
return value;
|
|
589
|
-
}
|
|
590
|
-
function makeGetSet(unit, keepTime) {
|
|
591
|
-
return function (value) {
|
|
592
|
-
if (value != null) {
|
|
593
|
-
set$1(this, unit, value);
|
|
594
|
-
hooks.updateOffset(this, keepTime);
|
|
595
|
-
return this;
|
|
596
|
-
} else {
|
|
597
|
-
return get(this, unit);
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
function get(mom, unit) {
|
|
602
|
-
return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
|
|
603
|
-
}
|
|
604
|
-
function set$1(mom, unit, value) {
|
|
605
|
-
if (mom.isValid() && !isNaN(value)) {
|
|
606
|
-
if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
|
|
607
|
-
value = toInt(value);
|
|
608
|
-
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
|
|
609
|
-
} else {
|
|
610
|
-
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
// MOMENTS
|
|
616
|
-
|
|
617
|
-
function stringGet(units) {
|
|
618
|
-
units = normalizeUnits(units);
|
|
619
|
-
if (isFunction(this[units])) {
|
|
620
|
-
return this[units]();
|
|
621
|
-
}
|
|
622
|
-
return this;
|
|
623
|
-
}
|
|
624
|
-
function stringSet(units, value) {
|
|
625
|
-
if (typeof units === 'object') {
|
|
626
|
-
units = normalizeObjectUnits(units);
|
|
627
|
-
var prioritized = getPrioritizedUnits(units),
|
|
628
|
-
i,
|
|
629
|
-
prioritizedLen = prioritized.length;
|
|
630
|
-
for (i = 0; i < prioritizedLen; i++) {
|
|
631
|
-
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
632
|
-
}
|
|
633
|
-
} else {
|
|
634
|
-
units = normalizeUnits(units);
|
|
635
|
-
if (isFunction(this[units])) {
|
|
636
|
-
return this[units](value);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
return this;
|
|
640
|
-
}
|
|
641
633
|
var match1 = /\d/,
|
|
642
634
|
// 0 - 9
|
|
643
635
|
match2 = /\d\d/,
|
|
@@ -673,6 +665,10 @@ var moment$1 = {
|
|
|
673
665
|
// any word (or two) characters or numbers including two/three word month in arabic.
|
|
674
666
|
// includes scottish gaelic two word and hyphenated months
|
|
675
667
|
matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
|
|
668
|
+
match1to2NoLeadingZero = /^[1-9]\d?/,
|
|
669
|
+
// 1-99
|
|
670
|
+
match1to2HasZero = /^([1-9]\d|\d)/,
|
|
671
|
+
// 0-99
|
|
676
672
|
regexes;
|
|
677
673
|
regexes = {};
|
|
678
674
|
function addRegexToken(token, regex, strictRegex) {
|
|
@@ -696,6 +692,22 @@ var moment$1 = {
|
|
|
696
692
|
function regexEscape(s) {
|
|
697
693
|
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
698
694
|
}
|
|
695
|
+
function absFloor(number) {
|
|
696
|
+
if (number < 0) {
|
|
697
|
+
// -0 -> 0
|
|
698
|
+
return Math.ceil(number) || 0;
|
|
699
|
+
} else {
|
|
700
|
+
return Math.floor(number);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function toInt(argumentForCoercion) {
|
|
704
|
+
var coercedNumber = +argumentForCoercion,
|
|
705
|
+
value = 0;
|
|
706
|
+
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
|
707
|
+
value = absFloor(coercedNumber);
|
|
708
|
+
}
|
|
709
|
+
return value;
|
|
710
|
+
}
|
|
699
711
|
var tokens = {};
|
|
700
712
|
function addParseToken(token, callback) {
|
|
701
713
|
var i,
|
|
@@ -725,6 +737,9 @@ var moment$1 = {
|
|
|
725
737
|
tokens[token](input, config._a, config, token);
|
|
726
738
|
}
|
|
727
739
|
}
|
|
740
|
+
function isLeapYear(year) {
|
|
741
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
742
|
+
}
|
|
728
743
|
var YEAR = 0,
|
|
729
744
|
MONTH = 1,
|
|
730
745
|
DATE = 2,
|
|
@@ -734,6 +749,157 @@ var moment$1 = {
|
|
|
734
749
|
MILLISECOND = 6,
|
|
735
750
|
WEEK = 7,
|
|
736
751
|
WEEKDAY = 8;
|
|
752
|
+
|
|
753
|
+
// FORMATTING
|
|
754
|
+
|
|
755
|
+
addFormatToken('Y', 0, 0, function () {
|
|
756
|
+
var y = this.year();
|
|
757
|
+
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
|
|
758
|
+
});
|
|
759
|
+
addFormatToken(0, ['YY', 2], 0, function () {
|
|
760
|
+
return this.year() % 100;
|
|
761
|
+
});
|
|
762
|
+
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
|
763
|
+
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
|
764
|
+
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
|
765
|
+
|
|
766
|
+
// PARSING
|
|
767
|
+
|
|
768
|
+
addRegexToken('Y', matchSigned);
|
|
769
|
+
addRegexToken('YY', match1to2, match2);
|
|
770
|
+
addRegexToken('YYYY', match1to4, match4);
|
|
771
|
+
addRegexToken('YYYYY', match1to6, match6);
|
|
772
|
+
addRegexToken('YYYYYY', match1to6, match6);
|
|
773
|
+
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
|
774
|
+
addParseToken('YYYY', function (input, array) {
|
|
775
|
+
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
|
776
|
+
});
|
|
777
|
+
addParseToken('YY', function (input, array) {
|
|
778
|
+
array[YEAR] = hooks.parseTwoDigitYear(input);
|
|
779
|
+
});
|
|
780
|
+
addParseToken('Y', function (input, array) {
|
|
781
|
+
array[YEAR] = parseInt(input, 10);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
// HELPERS
|
|
785
|
+
|
|
786
|
+
function daysInYear(year) {
|
|
787
|
+
return isLeapYear(year) ? 366 : 365;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// HOOKS
|
|
791
|
+
|
|
792
|
+
hooks.parseTwoDigitYear = function (input) {
|
|
793
|
+
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
// MOMENTS
|
|
797
|
+
|
|
798
|
+
var getSetYear = makeGetSet('FullYear', true);
|
|
799
|
+
function getIsLeapYear() {
|
|
800
|
+
return isLeapYear(this.year());
|
|
801
|
+
}
|
|
802
|
+
function makeGetSet(unit, keepTime) {
|
|
803
|
+
return function (value) {
|
|
804
|
+
if (value != null) {
|
|
805
|
+
set$1(this, unit, value);
|
|
806
|
+
hooks.updateOffset(this, keepTime);
|
|
807
|
+
return this;
|
|
808
|
+
} else {
|
|
809
|
+
return get(this, unit);
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
function get(mom, unit) {
|
|
814
|
+
if (!mom.isValid()) {
|
|
815
|
+
return NaN;
|
|
816
|
+
}
|
|
817
|
+
var d = mom._d,
|
|
818
|
+
isUTC = mom._isUTC;
|
|
819
|
+
switch (unit) {
|
|
820
|
+
case 'Milliseconds':
|
|
821
|
+
return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
|
|
822
|
+
case 'Seconds':
|
|
823
|
+
return isUTC ? d.getUTCSeconds() : d.getSeconds();
|
|
824
|
+
case 'Minutes':
|
|
825
|
+
return isUTC ? d.getUTCMinutes() : d.getMinutes();
|
|
826
|
+
case 'Hours':
|
|
827
|
+
return isUTC ? d.getUTCHours() : d.getHours();
|
|
828
|
+
case 'Date':
|
|
829
|
+
return isUTC ? d.getUTCDate() : d.getDate();
|
|
830
|
+
case 'Day':
|
|
831
|
+
return isUTC ? d.getUTCDay() : d.getDay();
|
|
832
|
+
case 'Month':
|
|
833
|
+
return isUTC ? d.getUTCMonth() : d.getMonth();
|
|
834
|
+
case 'FullYear':
|
|
835
|
+
return isUTC ? d.getUTCFullYear() : d.getFullYear();
|
|
836
|
+
default:
|
|
837
|
+
return NaN;
|
|
838
|
+
// Just in case
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
function set$1(mom, unit, value) {
|
|
842
|
+
var d, isUTC, year, month, date;
|
|
843
|
+
if (!mom.isValid() || isNaN(value)) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
d = mom._d;
|
|
847
|
+
isUTC = mom._isUTC;
|
|
848
|
+
switch (unit) {
|
|
849
|
+
case 'Milliseconds':
|
|
850
|
+
return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
|
|
851
|
+
case 'Seconds':
|
|
852
|
+
return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
|
|
853
|
+
case 'Minutes':
|
|
854
|
+
return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
|
|
855
|
+
case 'Hours':
|
|
856
|
+
return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
|
|
857
|
+
case 'Date':
|
|
858
|
+
return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
|
|
859
|
+
// case 'Day': // Not real
|
|
860
|
+
// return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
|
|
861
|
+
// case 'Month': // Not used because we need to pass two variables
|
|
862
|
+
// return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
|
|
863
|
+
case 'FullYear':
|
|
864
|
+
break;
|
|
865
|
+
// See below ...
|
|
866
|
+
default:
|
|
867
|
+
return;
|
|
868
|
+
// Just in case
|
|
869
|
+
}
|
|
870
|
+
year = value;
|
|
871
|
+
month = mom.month();
|
|
872
|
+
date = mom.date();
|
|
873
|
+
date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
|
|
874
|
+
void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// MOMENTS
|
|
878
|
+
|
|
879
|
+
function stringGet(units) {
|
|
880
|
+
units = normalizeUnits(units);
|
|
881
|
+
if (isFunction(this[units])) {
|
|
882
|
+
return this[units]();
|
|
883
|
+
}
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
function stringSet(units, value) {
|
|
887
|
+
if (typeof units === 'object') {
|
|
888
|
+
units = normalizeObjectUnits(units);
|
|
889
|
+
var prioritized = getPrioritizedUnits(units),
|
|
890
|
+
i,
|
|
891
|
+
prioritizedLen = prioritized.length;
|
|
892
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
893
|
+
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
894
|
+
}
|
|
895
|
+
} else {
|
|
896
|
+
units = normalizeUnits(units);
|
|
897
|
+
if (isFunction(this[units])) {
|
|
898
|
+
return this[units](value);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
return this;
|
|
902
|
+
}
|
|
737
903
|
function mod(n, x) {
|
|
738
904
|
return (n % x + x) % x;
|
|
739
905
|
}
|
|
@@ -773,17 +939,9 @@ var moment$1 = {
|
|
|
773
939
|
return this.localeData().months(this, format);
|
|
774
940
|
});
|
|
775
941
|
|
|
776
|
-
// ALIASES
|
|
777
|
-
|
|
778
|
-
addUnitAlias('month', 'M');
|
|
779
|
-
|
|
780
|
-
// PRIORITY
|
|
781
|
-
|
|
782
|
-
addUnitPriority('month', 8);
|
|
783
|
-
|
|
784
942
|
// PARSING
|
|
785
943
|
|
|
786
|
-
addRegexToken('M', match1to2);
|
|
944
|
+
addRegexToken('M', match1to2, match1to2NoLeadingZero);
|
|
787
945
|
addRegexToken('MM', match1to2, match2);
|
|
788
946
|
addRegexToken('MMM', function (isStrict, locale) {
|
|
789
947
|
return locale.monthsShortRegex(isStrict);
|
|
@@ -904,7 +1062,6 @@ var moment$1 = {
|
|
|
904
1062
|
// MOMENTS
|
|
905
1063
|
|
|
906
1064
|
function setMonth(mom, value) {
|
|
907
|
-
var dayOfMonth;
|
|
908
1065
|
if (!mom.isValid()) {
|
|
909
1066
|
// No op
|
|
910
1067
|
return mom;
|
|
@@ -920,8 +1077,10 @@ var moment$1 = {
|
|
|
920
1077
|
}
|
|
921
1078
|
}
|
|
922
1079
|
}
|
|
923
|
-
|
|
924
|
-
|
|
1080
|
+
var month = value,
|
|
1081
|
+
date = mom.date();
|
|
1082
|
+
date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
|
|
1083
|
+
void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
|
|
925
1084
|
return mom;
|
|
926
1085
|
}
|
|
927
1086
|
function getSetMonth(value) {
|
|
@@ -978,90 +1137,29 @@ var moment$1 = {
|
|
|
978
1137
|
longPieces = [],
|
|
979
1138
|
mixedPieces = [],
|
|
980
1139
|
i,
|
|
981
|
-
mom
|
|
1140
|
+
mom,
|
|
1141
|
+
shortP,
|
|
1142
|
+
longP;
|
|
982
1143
|
for (i = 0; i < 12; i++) {
|
|
983
1144
|
// make the regex if we don't have it already
|
|
984
1145
|
mom = createUTC([2000, i]);
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1146
|
+
shortP = regexEscape(this.monthsShort(mom, ''));
|
|
1147
|
+
longP = regexEscape(this.months(mom, ''));
|
|
1148
|
+
shortPieces.push(shortP);
|
|
1149
|
+
longPieces.push(longP);
|
|
1150
|
+
mixedPieces.push(longP);
|
|
1151
|
+
mixedPieces.push(shortP);
|
|
989
1152
|
}
|
|
990
1153
|
// Sorting makes sure if one month (or abbr) is a prefix of another it
|
|
991
1154
|
// will match the longer piece.
|
|
992
1155
|
shortPieces.sort(cmpLenRev);
|
|
993
1156
|
longPieces.sort(cmpLenRev);
|
|
994
1157
|
mixedPieces.sort(cmpLenRev);
|
|
995
|
-
for (i = 0; i < 12; i++) {
|
|
996
|
-
shortPieces[i] = regexEscape(shortPieces[i]);
|
|
997
|
-
longPieces[i] = regexEscape(longPieces[i]);
|
|
998
|
-
}
|
|
999
|
-
for (i = 0; i < 24; i++) {
|
|
1000
|
-
mixedPieces[i] = regexEscape(mixedPieces[i]);
|
|
1001
|
-
}
|
|
1002
1158
|
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
|
1003
1159
|
this._monthsShortRegex = this._monthsRegex;
|
|
1004
1160
|
this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
|
|
1005
1161
|
this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
|
|
1006
1162
|
}
|
|
1007
|
-
|
|
1008
|
-
// FORMATTING
|
|
1009
|
-
|
|
1010
|
-
addFormatToken('Y', 0, 0, function () {
|
|
1011
|
-
var y = this.year();
|
|
1012
|
-
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
|
|
1013
|
-
});
|
|
1014
|
-
addFormatToken(0, ['YY', 2], 0, function () {
|
|
1015
|
-
return this.year() % 100;
|
|
1016
|
-
});
|
|
1017
|
-
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
|
1018
|
-
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
|
1019
|
-
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
|
1020
|
-
|
|
1021
|
-
// ALIASES
|
|
1022
|
-
|
|
1023
|
-
addUnitAlias('year', 'y');
|
|
1024
|
-
|
|
1025
|
-
// PRIORITIES
|
|
1026
|
-
|
|
1027
|
-
addUnitPriority('year', 1);
|
|
1028
|
-
|
|
1029
|
-
// PARSING
|
|
1030
|
-
|
|
1031
|
-
addRegexToken('Y', matchSigned);
|
|
1032
|
-
addRegexToken('YY', match1to2, match2);
|
|
1033
|
-
addRegexToken('YYYY', match1to4, match4);
|
|
1034
|
-
addRegexToken('YYYYY', match1to6, match6);
|
|
1035
|
-
addRegexToken('YYYYYY', match1to6, match6);
|
|
1036
|
-
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
|
1037
|
-
addParseToken('YYYY', function (input, array) {
|
|
1038
|
-
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
|
1039
|
-
});
|
|
1040
|
-
addParseToken('YY', function (input, array) {
|
|
1041
|
-
array[YEAR] = hooks.parseTwoDigitYear(input);
|
|
1042
|
-
});
|
|
1043
|
-
addParseToken('Y', function (input, array) {
|
|
1044
|
-
array[YEAR] = parseInt(input, 10);
|
|
1045
|
-
});
|
|
1046
|
-
|
|
1047
|
-
// HELPERS
|
|
1048
|
-
|
|
1049
|
-
function daysInYear(year) {
|
|
1050
|
-
return isLeapYear(year) ? 366 : 365;
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
// HOOKS
|
|
1054
|
-
|
|
1055
|
-
hooks.parseTwoDigitYear = function (input) {
|
|
1056
|
-
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
// MOMENTS
|
|
1060
|
-
|
|
1061
|
-
var getSetYear = makeGetSet('FullYear', true);
|
|
1062
|
-
function getIsLeapYear() {
|
|
1063
|
-
return isLeapYear(this.year());
|
|
1064
|
-
}
|
|
1065
1163
|
function createDate(y, m, d, h, M, s, ms) {
|
|
1066
1164
|
// can't just apply() to create a date:
|
|
1067
1165
|
// https://stackoverflow.com/q/181348
|
|
@@ -1158,21 +1256,11 @@ var moment$1 = {
|
|
|
1158
1256
|
addFormatToken('w', ['ww', 2], 'wo', 'week');
|
|
1159
1257
|
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
|
|
1160
1258
|
|
|
1161
|
-
// ALIASES
|
|
1162
|
-
|
|
1163
|
-
addUnitAlias('week', 'w');
|
|
1164
|
-
addUnitAlias('isoWeek', 'W');
|
|
1165
|
-
|
|
1166
|
-
// PRIORITIES
|
|
1167
|
-
|
|
1168
|
-
addUnitPriority('week', 5);
|
|
1169
|
-
addUnitPriority('isoWeek', 5);
|
|
1170
|
-
|
|
1171
1259
|
// PARSING
|
|
1172
1260
|
|
|
1173
|
-
addRegexToken('w', match1to2);
|
|
1261
|
+
addRegexToken('w', match1to2, match1to2NoLeadingZero);
|
|
1174
1262
|
addRegexToken('ww', match1to2, match2);
|
|
1175
|
-
addRegexToken('W', match1to2);
|
|
1263
|
+
addRegexToken('W', match1to2, match1to2NoLeadingZero);
|
|
1176
1264
|
addRegexToken('WW', match1to2, match2);
|
|
1177
1265
|
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
|
|
1178
1266
|
week[token.substr(0, 1)] = toInt(input);
|
|
@@ -1223,17 +1311,6 @@ var moment$1 = {
|
|
|
1223
1311
|
addFormatToken('e', 0, 0, 'weekday');
|
|
1224
1312
|
addFormatToken('E', 0, 0, 'isoWeekday');
|
|
1225
1313
|
|
|
1226
|
-
// ALIASES
|
|
1227
|
-
|
|
1228
|
-
addUnitAlias('day', 'd');
|
|
1229
|
-
addUnitAlias('weekday', 'e');
|
|
1230
|
-
addUnitAlias('isoWeekday', 'E');
|
|
1231
|
-
|
|
1232
|
-
// PRIORITY
|
|
1233
|
-
addUnitPriority('day', 11);
|
|
1234
|
-
addUnitPriority('weekday', 11);
|
|
1235
|
-
addUnitPriority('isoWeekday', 11);
|
|
1236
|
-
|
|
1237
1314
|
// PARSING
|
|
1238
1315
|
|
|
1239
1316
|
addRegexToken('d', match1to2);
|
|
@@ -1410,7 +1487,7 @@ var moment$1 = {
|
|
|
1410
1487
|
if (!this.isValid()) {
|
|
1411
1488
|
return input != null ? this : NaN;
|
|
1412
1489
|
}
|
|
1413
|
-
var day = this
|
|
1490
|
+
var day = get(this, 'Day');
|
|
1414
1491
|
if (input != null) {
|
|
1415
1492
|
input = parseWeekday(input, this.localeData());
|
|
1416
1493
|
return this.add(input - day, 'd');
|
|
@@ -1563,13 +1640,6 @@ var moment$1 = {
|
|
|
1563
1640
|
meridiem('a', true);
|
|
1564
1641
|
meridiem('A', false);
|
|
1565
1642
|
|
|
1566
|
-
// ALIASES
|
|
1567
|
-
|
|
1568
|
-
addUnitAlias('hour', 'h');
|
|
1569
|
-
|
|
1570
|
-
// PRIORITY
|
|
1571
|
-
addUnitPriority('hour', 13);
|
|
1572
|
-
|
|
1573
1643
|
// PARSING
|
|
1574
1644
|
|
|
1575
1645
|
function matchMeridiem(isStrict, locale) {
|
|
@@ -1577,9 +1647,9 @@ var moment$1 = {
|
|
|
1577
1647
|
}
|
|
1578
1648
|
addRegexToken('a', matchMeridiem);
|
|
1579
1649
|
addRegexToken('A', matchMeridiem);
|
|
1580
|
-
addRegexToken('H', match1to2);
|
|
1581
|
-
addRegexToken('h', match1to2);
|
|
1582
|
-
addRegexToken('k', match1to2);
|
|
1650
|
+
addRegexToken('H', match1to2, match1to2HasZero);
|
|
1651
|
+
addRegexToken('h', match1to2, match1to2NoLeadingZero);
|
|
1652
|
+
addRegexToken('k', match1to2, match1to2NoLeadingZero);
|
|
1583
1653
|
addRegexToken('HH', match1to2, match2);
|
|
1584
1654
|
addRegexToken('hh', match1to2, match2);
|
|
1585
1655
|
addRegexToken('kk', match1to2, match2);
|
|
@@ -1712,7 +1782,8 @@ var moment$1 = {
|
|
|
1712
1782
|
}
|
|
1713
1783
|
function isLocaleNameSane(name) {
|
|
1714
1784
|
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
|
1715
|
-
|
|
1785
|
+
// Ensure name is available and function returns boolean
|
|
1786
|
+
return !!(name && name.match('^[^/\\\\]*$'));
|
|
1716
1787
|
}
|
|
1717
1788
|
function loadLocale(name) {
|
|
1718
1789
|
var oldLocale = null,
|
|
@@ -3607,14 +3678,20 @@ var moment$1 = {
|
|
|
3607
3678
|
mixedPieces = [],
|
|
3608
3679
|
i,
|
|
3609
3680
|
l,
|
|
3681
|
+
erasName,
|
|
3682
|
+
erasAbbr,
|
|
3683
|
+
erasNarrow,
|
|
3610
3684
|
eras = this.eras();
|
|
3611
3685
|
for (i = 0, l = eras.length; i < l; ++i) {
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3686
|
+
erasName = regexEscape(eras[i].name);
|
|
3687
|
+
erasAbbr = regexEscape(eras[i].abbr);
|
|
3688
|
+
erasNarrow = regexEscape(eras[i].narrow);
|
|
3689
|
+
namePieces.push(erasName);
|
|
3690
|
+
abbrPieces.push(erasAbbr);
|
|
3691
|
+
narrowPieces.push(erasNarrow);
|
|
3692
|
+
mixedPieces.push(erasName);
|
|
3693
|
+
mixedPieces.push(erasAbbr);
|
|
3694
|
+
mixedPieces.push(erasNarrow);
|
|
3618
3695
|
}
|
|
3619
3696
|
this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
|
3620
3697
|
this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
|
|
@@ -3640,14 +3717,6 @@ var moment$1 = {
|
|
|
3640
3717
|
|
|
3641
3718
|
// ALIASES
|
|
3642
3719
|
|
|
3643
|
-
addUnitAlias('weekYear', 'gg');
|
|
3644
|
-
addUnitAlias('isoWeekYear', 'GG');
|
|
3645
|
-
|
|
3646
|
-
// PRIORITY
|
|
3647
|
-
|
|
3648
|
-
addUnitPriority('weekYear', 1);
|
|
3649
|
-
addUnitPriority('isoWeekYear', 1);
|
|
3650
|
-
|
|
3651
3720
|
// PARSING
|
|
3652
3721
|
|
|
3653
3722
|
addRegexToken('G', matchSigned);
|
|
@@ -3668,7 +3737,7 @@ var moment$1 = {
|
|
|
3668
3737
|
// MOMENTS
|
|
3669
3738
|
|
|
3670
3739
|
function getSetWeekYear(input) {
|
|
3671
|
-
return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);
|
|
3740
|
+
return getSetWeekYearHelper.call(this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy);
|
|
3672
3741
|
}
|
|
3673
3742
|
function getSetISOWeekYear(input) {
|
|
3674
3743
|
return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
|
|
@@ -3712,14 +3781,6 @@ var moment$1 = {
|
|
|
3712
3781
|
|
|
3713
3782
|
addFormatToken('Q', 0, 'Qo', 'quarter');
|
|
3714
3783
|
|
|
3715
|
-
// ALIASES
|
|
3716
|
-
|
|
3717
|
-
addUnitAlias('quarter', 'Q');
|
|
3718
|
-
|
|
3719
|
-
// PRIORITY
|
|
3720
|
-
|
|
3721
|
-
addUnitPriority('quarter', 7);
|
|
3722
|
-
|
|
3723
3784
|
// PARSING
|
|
3724
3785
|
|
|
3725
3786
|
addRegexToken('Q', match1);
|
|
@@ -3737,16 +3798,9 @@ var moment$1 = {
|
|
|
3737
3798
|
|
|
3738
3799
|
addFormatToken('D', ['DD', 2], 'Do', 'date');
|
|
3739
3800
|
|
|
3740
|
-
// ALIASES
|
|
3741
|
-
|
|
3742
|
-
addUnitAlias('date', 'D');
|
|
3743
|
-
|
|
3744
|
-
// PRIORITY
|
|
3745
|
-
addUnitPriority('date', 9);
|
|
3746
|
-
|
|
3747
3801
|
// PARSING
|
|
3748
3802
|
|
|
3749
|
-
addRegexToken('D', match1to2);
|
|
3803
|
+
addRegexToken('D', match1to2, match1to2NoLeadingZero);
|
|
3750
3804
|
addRegexToken('DD', match1to2, match2);
|
|
3751
3805
|
addRegexToken('Do', function (isStrict, locale) {
|
|
3752
3806
|
// TODO: Remove "ordinalParse" fallback in next major release.
|
|
@@ -3765,13 +3819,6 @@ var moment$1 = {
|
|
|
3765
3819
|
|
|
3766
3820
|
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
|
|
3767
3821
|
|
|
3768
|
-
// ALIASES
|
|
3769
|
-
|
|
3770
|
-
addUnitAlias('dayOfYear', 'DDD');
|
|
3771
|
-
|
|
3772
|
-
// PRIORITY
|
|
3773
|
-
addUnitPriority('dayOfYear', 4);
|
|
3774
|
-
|
|
3775
3822
|
// PARSING
|
|
3776
3823
|
|
|
3777
3824
|
addRegexToken('DDD', match1to3);
|
|
@@ -3793,17 +3840,9 @@ var moment$1 = {
|
|
|
3793
3840
|
|
|
3794
3841
|
addFormatToken('m', ['mm', 2], 0, 'minute');
|
|
3795
3842
|
|
|
3796
|
-
// ALIASES
|
|
3797
|
-
|
|
3798
|
-
addUnitAlias('minute', 'm');
|
|
3799
|
-
|
|
3800
|
-
// PRIORITY
|
|
3801
|
-
|
|
3802
|
-
addUnitPriority('minute', 14);
|
|
3803
|
-
|
|
3804
3843
|
// PARSING
|
|
3805
3844
|
|
|
3806
|
-
addRegexToken('m', match1to2);
|
|
3845
|
+
addRegexToken('m', match1to2, match1to2HasZero);
|
|
3807
3846
|
addRegexToken('mm', match1to2, match2);
|
|
3808
3847
|
addParseToken(['m', 'mm'], MINUTE);
|
|
3809
3848
|
|
|
@@ -3815,17 +3854,9 @@ var moment$1 = {
|
|
|
3815
3854
|
|
|
3816
3855
|
addFormatToken('s', ['ss', 2], 0, 'second');
|
|
3817
3856
|
|
|
3818
|
-
// ALIASES
|
|
3819
|
-
|
|
3820
|
-
addUnitAlias('second', 's');
|
|
3821
|
-
|
|
3822
|
-
// PRIORITY
|
|
3823
|
-
|
|
3824
|
-
addUnitPriority('second', 15);
|
|
3825
|
-
|
|
3826
3857
|
// PARSING
|
|
3827
3858
|
|
|
3828
|
-
addRegexToken('s', match1to2);
|
|
3859
|
+
addRegexToken('s', match1to2, match1to2HasZero);
|
|
3829
3860
|
addRegexToken('ss', match1to2, match2);
|
|
3830
3861
|
addParseToken(['s', 'ss'], SECOND);
|
|
3831
3862
|
|
|
@@ -3861,14 +3892,6 @@ var moment$1 = {
|
|
|
3861
3892
|
return this.millisecond() * 1000000;
|
|
3862
3893
|
});
|
|
3863
3894
|
|
|
3864
|
-
// ALIASES
|
|
3865
|
-
|
|
3866
|
-
addUnitAlias('millisecond', 'ms');
|
|
3867
|
-
|
|
3868
|
-
// PRIORITY
|
|
3869
|
-
|
|
3870
|
-
addUnitPriority('millisecond', 16);
|
|
3871
|
-
|
|
3872
3895
|
// PARSING
|
|
3873
3896
|
|
|
3874
3897
|
addRegexToken('S', match1to3, match1);
|
|
@@ -4261,14 +4284,6 @@ var moment$1 = {
|
|
|
4261
4284
|
}
|
|
4262
4285
|
}
|
|
4263
4286
|
}
|
|
4264
|
-
|
|
4265
|
-
// TODO: Use this.as('ms')?
|
|
4266
|
-
function valueOf$1() {
|
|
4267
|
-
if (!this.isValid()) {
|
|
4268
|
-
return NaN;
|
|
4269
|
-
}
|
|
4270
|
-
return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
|
|
4271
|
-
}
|
|
4272
4287
|
function makeAs(alias) {
|
|
4273
4288
|
return function () {
|
|
4274
4289
|
return this.as(alias);
|
|
@@ -4282,7 +4297,8 @@ var moment$1 = {
|
|
|
4282
4297
|
asWeeks = makeAs('w'),
|
|
4283
4298
|
asMonths = makeAs('M'),
|
|
4284
4299
|
asQuarters = makeAs('Q'),
|
|
4285
|
-
asYears = makeAs('y')
|
|
4300
|
+
asYears = makeAs('y'),
|
|
4301
|
+
valueOf$1 = asMilliseconds;
|
|
4286
4302
|
function clone$1() {
|
|
4287
4303
|
return createDuration(this);
|
|
4288
4304
|
}
|
|
@@ -4505,7 +4521,7 @@ var moment$1 = {
|
|
|
4505
4521
|
|
|
4506
4522
|
//! moment.js
|
|
4507
4523
|
|
|
4508
|
-
hooks.version = '2.
|
|
4524
|
+
hooks.version = '2.30.1';
|
|
4509
4525
|
setHookCallback(createLocal);
|
|
4510
4526
|
hooks.fn = proto;
|
|
4511
4527
|
hooks.min = min;
|
|
@@ -6118,7 +6134,7 @@ var FocusLock$1 = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, pare
|
|
|
6118
6134
|
var hasLeadingGuards = noFocusGuards !== true;
|
|
6119
6135
|
var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';
|
|
6120
6136
|
var mergedRef = useMergeRefs([parentRef, setObserveNode]);
|
|
6121
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [
|
|
6137
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/
|
|
6122
6138
|
// nearest focus guard
|
|
6123
6139
|
React.createElement("div", {
|
|
6124
6140
|
key: "guard-first",
|
|
@@ -9079,7 +9095,8 @@ function RecurringDates(props) {
|
|
|
9079
9095
|
defaultRecurrences,
|
|
9080
9096
|
hideEndDate,
|
|
9081
9097
|
hideCustom,
|
|
9082
|
-
dateTimeOptions
|
|
9098
|
+
dateTimeOptions,
|
|
9099
|
+
dateOnly
|
|
9083
9100
|
} = {
|
|
9084
9101
|
...pluginConfig,
|
|
9085
9102
|
...options
|
|
@@ -9123,6 +9140,21 @@ function RecurringDates(props) {
|
|
|
9123
9140
|
...dateTimeOptions
|
|
9124
9141
|
};
|
|
9125
9142
|
}
|
|
9143
|
+
if (dateOnly === true) {
|
|
9144
|
+
if ((startDateMember == null ? void 0 : startDateMember.kind) == "field") {
|
|
9145
|
+
startDateMember.field.schemaType.name = "date";
|
|
9146
|
+
}
|
|
9147
|
+
if ((endDateMember == null ? void 0 : endDateMember.kind) == "field") {
|
|
9148
|
+
endDateMember.field.schemaType.name = "date";
|
|
9149
|
+
}
|
|
9150
|
+
} else {
|
|
9151
|
+
if ((startDateMember == null ? void 0 : startDateMember.kind) == "field") {
|
|
9152
|
+
startDateMember.field.schemaType.name = "datetime";
|
|
9153
|
+
}
|
|
9154
|
+
if ((endDateMember == null ? void 0 : endDateMember.kind) == "field") {
|
|
9155
|
+
endDateMember.field.schemaType.name = "datetime";
|
|
9156
|
+
}
|
|
9157
|
+
}
|
|
9126
9158
|
const hasEndDate = currentValue && currentValue.endDate;
|
|
9127
9159
|
return /* @__PURE__ */jsxs(Stack, {
|
|
9128
9160
|
space: 3,
|
|
@@ -9197,7 +9229,8 @@ function RecurringDates(props) {
|
|
|
9197
9229
|
}
|
|
9198
9230
|
var recurringDateSchema = config => {
|
|
9199
9231
|
const {
|
|
9200
|
-
dateTimeOptions
|
|
9232
|
+
dateTimeOptions,
|
|
9233
|
+
dateOnly
|
|
9201
9234
|
} = config;
|
|
9202
9235
|
return defineField({
|
|
9203
9236
|
name: "recurringDates",
|
|
@@ -9206,13 +9239,13 @@ var recurringDateSchema = config => {
|
|
|
9206
9239
|
fields: [defineField({
|
|
9207
9240
|
title: "Start Date",
|
|
9208
9241
|
name: "startDate",
|
|
9209
|
-
type: "datetime",
|
|
9242
|
+
type: dateOnly ? "date" : "datetime",
|
|
9210
9243
|
options: dateTimeOptions,
|
|
9211
9244
|
validation: Rule => Rule.required()
|
|
9212
9245
|
}), defineField({
|
|
9213
9246
|
title: "End Date",
|
|
9214
9247
|
name: "endDate",
|
|
9215
|
-
type: "datetime",
|
|
9248
|
+
type: dateOnly ? "date" : "datetime",
|
|
9216
9249
|
options: dateTimeOptions,
|
|
9217
9250
|
validation: Rule => Rule.min(Rule.valueOfField("startDate"))
|
|
9218
9251
|
}), defineField({
|