sanity-plugin-recurring-dates 1.0.3 → 1.1.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/LICENSE +1 -1
- package/README.md +18 -0
- package/dist/index.d.ts +2 -1
- 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 +2 -1
package/dist/index.js
CHANGED
|
@@ -185,20 +185,23 @@ var moment$1 = {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
function isValid(m) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
var flags = null,
|
|
189
|
+
parsedParts = false,
|
|
190
|
+
isNowValid = m._d && !isNaN(m._d.getTime());
|
|
191
|
+
if (isNowValid) {
|
|
192
|
+
flags = getParsingFlags(m);
|
|
193
|
+
parsedParts = some.call(flags.parsedDateParts, function (i) {
|
|
194
|
+
return i != null;
|
|
195
|
+
});
|
|
196
|
+
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);
|
|
194
197
|
if (m._strict) {
|
|
195
198
|
isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
|
|
196
199
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
}
|
|
201
|
+
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
|
202
|
+
m._isValid = isNowValid;
|
|
203
|
+
} else {
|
|
204
|
+
return isNowValid;
|
|
202
205
|
}
|
|
203
206
|
return m._isValid;
|
|
204
207
|
}
|
|
@@ -550,11 +553,56 @@ var moment$1 = {
|
|
|
550
553
|
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
|
551
554
|
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
|
552
555
|
}
|
|
553
|
-
var aliases = {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
556
|
+
var aliases = {
|
|
557
|
+
D: 'date',
|
|
558
|
+
dates: 'date',
|
|
559
|
+
date: 'date',
|
|
560
|
+
d: 'day',
|
|
561
|
+
days: 'day',
|
|
562
|
+
day: 'day',
|
|
563
|
+
e: 'weekday',
|
|
564
|
+
weekdays: 'weekday',
|
|
565
|
+
weekday: 'weekday',
|
|
566
|
+
E: 'isoWeekday',
|
|
567
|
+
isoweekdays: 'isoWeekday',
|
|
568
|
+
isoweekday: 'isoWeekday',
|
|
569
|
+
DDD: 'dayOfYear',
|
|
570
|
+
dayofyears: 'dayOfYear',
|
|
571
|
+
dayofyear: 'dayOfYear',
|
|
572
|
+
h: 'hour',
|
|
573
|
+
hours: 'hour',
|
|
574
|
+
hour: 'hour',
|
|
575
|
+
ms: 'millisecond',
|
|
576
|
+
milliseconds: 'millisecond',
|
|
577
|
+
millisecond: 'millisecond',
|
|
578
|
+
m: 'minute',
|
|
579
|
+
minutes: 'minute',
|
|
580
|
+
minute: 'minute',
|
|
581
|
+
M: 'month',
|
|
582
|
+
months: 'month',
|
|
583
|
+
month: 'month',
|
|
584
|
+
Q: 'quarter',
|
|
585
|
+
quarters: 'quarter',
|
|
586
|
+
quarter: 'quarter',
|
|
587
|
+
s: 'second',
|
|
588
|
+
seconds: 'second',
|
|
589
|
+
second: 'second',
|
|
590
|
+
gg: 'weekYear',
|
|
591
|
+
weekyears: 'weekYear',
|
|
592
|
+
weekyear: 'weekYear',
|
|
593
|
+
GG: 'isoWeekYear',
|
|
594
|
+
isoweekyears: 'isoWeekYear',
|
|
595
|
+
isoweekyear: 'isoWeekYear',
|
|
596
|
+
w: 'week',
|
|
597
|
+
weeks: 'week',
|
|
598
|
+
week: 'week',
|
|
599
|
+
W: 'isoWeek',
|
|
600
|
+
isoweeks: 'isoWeek',
|
|
601
|
+
isoweek: 'isoWeek',
|
|
602
|
+
y: 'year',
|
|
603
|
+
years: 'year',
|
|
604
|
+
year: 'year'
|
|
605
|
+
};
|
|
558
606
|
function normalizeUnits(units) {
|
|
559
607
|
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
|
|
560
608
|
}
|
|
@@ -572,10 +620,24 @@ var moment$1 = {
|
|
|
572
620
|
}
|
|
573
621
|
return normalizedInput;
|
|
574
622
|
}
|
|
575
|
-
var priorities = {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
623
|
+
var priorities = {
|
|
624
|
+
date: 9,
|
|
625
|
+
day: 11,
|
|
626
|
+
weekday: 11,
|
|
627
|
+
isoWeekday: 11,
|
|
628
|
+
dayOfYear: 4,
|
|
629
|
+
hour: 13,
|
|
630
|
+
millisecond: 16,
|
|
631
|
+
minute: 14,
|
|
632
|
+
month: 8,
|
|
633
|
+
quarter: 7,
|
|
634
|
+
second: 15,
|
|
635
|
+
weekYear: 1,
|
|
636
|
+
isoWeekYear: 1,
|
|
637
|
+
week: 5,
|
|
638
|
+
isoWeek: 5,
|
|
639
|
+
year: 1
|
|
640
|
+
};
|
|
579
641
|
function getPrioritizedUnits(unitsObj) {
|
|
580
642
|
var units = [],
|
|
581
643
|
u;
|
|
@@ -592,76 +654,6 @@ var moment$1 = {
|
|
|
592
654
|
});
|
|
593
655
|
return units;
|
|
594
656
|
}
|
|
595
|
-
function isLeapYear(year) {
|
|
596
|
-
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
597
|
-
}
|
|
598
|
-
function absFloor(number) {
|
|
599
|
-
if (number < 0) {
|
|
600
|
-
// -0 -> 0
|
|
601
|
-
return Math.ceil(number) || 0;
|
|
602
|
-
} else {
|
|
603
|
-
return Math.floor(number);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
function toInt(argumentForCoercion) {
|
|
607
|
-
var coercedNumber = +argumentForCoercion,
|
|
608
|
-
value = 0;
|
|
609
|
-
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
|
610
|
-
value = absFloor(coercedNumber);
|
|
611
|
-
}
|
|
612
|
-
return value;
|
|
613
|
-
}
|
|
614
|
-
function makeGetSet(unit, keepTime) {
|
|
615
|
-
return function (value) {
|
|
616
|
-
if (value != null) {
|
|
617
|
-
set$1(this, unit, value);
|
|
618
|
-
hooks.updateOffset(this, keepTime);
|
|
619
|
-
return this;
|
|
620
|
-
} else {
|
|
621
|
-
return get(this, unit);
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
function get(mom, unit) {
|
|
626
|
-
return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
|
|
627
|
-
}
|
|
628
|
-
function set$1(mom, unit, value) {
|
|
629
|
-
if (mom.isValid() && !isNaN(value)) {
|
|
630
|
-
if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
|
|
631
|
-
value = toInt(value);
|
|
632
|
-
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
|
|
633
|
-
} else {
|
|
634
|
-
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
// MOMENTS
|
|
640
|
-
|
|
641
|
-
function stringGet(units) {
|
|
642
|
-
units = normalizeUnits(units);
|
|
643
|
-
if (isFunction(this[units])) {
|
|
644
|
-
return this[units]();
|
|
645
|
-
}
|
|
646
|
-
return this;
|
|
647
|
-
}
|
|
648
|
-
function stringSet(units, value) {
|
|
649
|
-
if (typeof units === 'object') {
|
|
650
|
-
units = normalizeObjectUnits(units);
|
|
651
|
-
var prioritized = getPrioritizedUnits(units),
|
|
652
|
-
i,
|
|
653
|
-
prioritizedLen = prioritized.length;
|
|
654
|
-
for (i = 0; i < prioritizedLen; i++) {
|
|
655
|
-
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
656
|
-
}
|
|
657
|
-
} else {
|
|
658
|
-
units = normalizeUnits(units);
|
|
659
|
-
if (isFunction(this[units])) {
|
|
660
|
-
return this[units](value);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
return this;
|
|
664
|
-
}
|
|
665
657
|
var match1 = /\d/,
|
|
666
658
|
// 0 - 9
|
|
667
659
|
match2 = /\d\d/,
|
|
@@ -697,6 +689,10 @@ var moment$1 = {
|
|
|
697
689
|
// any word (or two) characters or numbers including two/three word month in arabic.
|
|
698
690
|
// includes scottish gaelic two word and hyphenated months
|
|
699
691
|
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,
|
|
692
|
+
match1to2NoLeadingZero = /^[1-9]\d?/,
|
|
693
|
+
// 1-99
|
|
694
|
+
match1to2HasZero = /^([1-9]\d|\d)/,
|
|
695
|
+
// 0-99
|
|
700
696
|
regexes;
|
|
701
697
|
regexes = {};
|
|
702
698
|
function addRegexToken(token, regex, strictRegex) {
|
|
@@ -720,6 +716,22 @@ var moment$1 = {
|
|
|
720
716
|
function regexEscape(s) {
|
|
721
717
|
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
722
718
|
}
|
|
719
|
+
function absFloor(number) {
|
|
720
|
+
if (number < 0) {
|
|
721
|
+
// -0 -> 0
|
|
722
|
+
return Math.ceil(number) || 0;
|
|
723
|
+
} else {
|
|
724
|
+
return Math.floor(number);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
function toInt(argumentForCoercion) {
|
|
728
|
+
var coercedNumber = +argumentForCoercion,
|
|
729
|
+
value = 0;
|
|
730
|
+
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
|
731
|
+
value = absFloor(coercedNumber);
|
|
732
|
+
}
|
|
733
|
+
return value;
|
|
734
|
+
}
|
|
723
735
|
var tokens = {};
|
|
724
736
|
function addParseToken(token, callback) {
|
|
725
737
|
var i,
|
|
@@ -749,6 +761,9 @@ var moment$1 = {
|
|
|
749
761
|
tokens[token](input, config._a, config, token);
|
|
750
762
|
}
|
|
751
763
|
}
|
|
764
|
+
function isLeapYear(year) {
|
|
765
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
766
|
+
}
|
|
752
767
|
var YEAR = 0,
|
|
753
768
|
MONTH = 1,
|
|
754
769
|
DATE = 2,
|
|
@@ -758,6 +773,157 @@ var moment$1 = {
|
|
|
758
773
|
MILLISECOND = 6,
|
|
759
774
|
WEEK = 7,
|
|
760
775
|
WEEKDAY = 8;
|
|
776
|
+
|
|
777
|
+
// FORMATTING
|
|
778
|
+
|
|
779
|
+
addFormatToken('Y', 0, 0, function () {
|
|
780
|
+
var y = this.year();
|
|
781
|
+
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
|
|
782
|
+
});
|
|
783
|
+
addFormatToken(0, ['YY', 2], 0, function () {
|
|
784
|
+
return this.year() % 100;
|
|
785
|
+
});
|
|
786
|
+
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
|
787
|
+
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
|
788
|
+
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
|
789
|
+
|
|
790
|
+
// PARSING
|
|
791
|
+
|
|
792
|
+
addRegexToken('Y', matchSigned);
|
|
793
|
+
addRegexToken('YY', match1to2, match2);
|
|
794
|
+
addRegexToken('YYYY', match1to4, match4);
|
|
795
|
+
addRegexToken('YYYYY', match1to6, match6);
|
|
796
|
+
addRegexToken('YYYYYY', match1to6, match6);
|
|
797
|
+
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
|
798
|
+
addParseToken('YYYY', function (input, array) {
|
|
799
|
+
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
|
800
|
+
});
|
|
801
|
+
addParseToken('YY', function (input, array) {
|
|
802
|
+
array[YEAR] = hooks.parseTwoDigitYear(input);
|
|
803
|
+
});
|
|
804
|
+
addParseToken('Y', function (input, array) {
|
|
805
|
+
array[YEAR] = parseInt(input, 10);
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
// HELPERS
|
|
809
|
+
|
|
810
|
+
function daysInYear(year) {
|
|
811
|
+
return isLeapYear(year) ? 366 : 365;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// HOOKS
|
|
815
|
+
|
|
816
|
+
hooks.parseTwoDigitYear = function (input) {
|
|
817
|
+
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// MOMENTS
|
|
821
|
+
|
|
822
|
+
var getSetYear = makeGetSet('FullYear', true);
|
|
823
|
+
function getIsLeapYear() {
|
|
824
|
+
return isLeapYear(this.year());
|
|
825
|
+
}
|
|
826
|
+
function makeGetSet(unit, keepTime) {
|
|
827
|
+
return function (value) {
|
|
828
|
+
if (value != null) {
|
|
829
|
+
set$1(this, unit, value);
|
|
830
|
+
hooks.updateOffset(this, keepTime);
|
|
831
|
+
return this;
|
|
832
|
+
} else {
|
|
833
|
+
return get(this, unit);
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
function get(mom, unit) {
|
|
838
|
+
if (!mom.isValid()) {
|
|
839
|
+
return NaN;
|
|
840
|
+
}
|
|
841
|
+
var d = mom._d,
|
|
842
|
+
isUTC = mom._isUTC;
|
|
843
|
+
switch (unit) {
|
|
844
|
+
case 'Milliseconds':
|
|
845
|
+
return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
|
|
846
|
+
case 'Seconds':
|
|
847
|
+
return isUTC ? d.getUTCSeconds() : d.getSeconds();
|
|
848
|
+
case 'Minutes':
|
|
849
|
+
return isUTC ? d.getUTCMinutes() : d.getMinutes();
|
|
850
|
+
case 'Hours':
|
|
851
|
+
return isUTC ? d.getUTCHours() : d.getHours();
|
|
852
|
+
case 'Date':
|
|
853
|
+
return isUTC ? d.getUTCDate() : d.getDate();
|
|
854
|
+
case 'Day':
|
|
855
|
+
return isUTC ? d.getUTCDay() : d.getDay();
|
|
856
|
+
case 'Month':
|
|
857
|
+
return isUTC ? d.getUTCMonth() : d.getMonth();
|
|
858
|
+
case 'FullYear':
|
|
859
|
+
return isUTC ? d.getUTCFullYear() : d.getFullYear();
|
|
860
|
+
default:
|
|
861
|
+
return NaN;
|
|
862
|
+
// Just in case
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function set$1(mom, unit, value) {
|
|
866
|
+
var d, isUTC, year, month, date;
|
|
867
|
+
if (!mom.isValid() || isNaN(value)) {
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
d = mom._d;
|
|
871
|
+
isUTC = mom._isUTC;
|
|
872
|
+
switch (unit) {
|
|
873
|
+
case 'Milliseconds':
|
|
874
|
+
return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
|
|
875
|
+
case 'Seconds':
|
|
876
|
+
return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
|
|
877
|
+
case 'Minutes':
|
|
878
|
+
return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
|
|
879
|
+
case 'Hours':
|
|
880
|
+
return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
|
|
881
|
+
case 'Date':
|
|
882
|
+
return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
|
|
883
|
+
// case 'Day': // Not real
|
|
884
|
+
// return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
|
|
885
|
+
// case 'Month': // Not used because we need to pass two variables
|
|
886
|
+
// return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
|
|
887
|
+
case 'FullYear':
|
|
888
|
+
break;
|
|
889
|
+
// See below ...
|
|
890
|
+
default:
|
|
891
|
+
return;
|
|
892
|
+
// Just in case
|
|
893
|
+
}
|
|
894
|
+
year = value;
|
|
895
|
+
month = mom.month();
|
|
896
|
+
date = mom.date();
|
|
897
|
+
date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
|
|
898
|
+
void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// MOMENTS
|
|
902
|
+
|
|
903
|
+
function stringGet(units) {
|
|
904
|
+
units = normalizeUnits(units);
|
|
905
|
+
if (isFunction(this[units])) {
|
|
906
|
+
return this[units]();
|
|
907
|
+
}
|
|
908
|
+
return this;
|
|
909
|
+
}
|
|
910
|
+
function stringSet(units, value) {
|
|
911
|
+
if (typeof units === 'object') {
|
|
912
|
+
units = normalizeObjectUnits(units);
|
|
913
|
+
var prioritized = getPrioritizedUnits(units),
|
|
914
|
+
i,
|
|
915
|
+
prioritizedLen = prioritized.length;
|
|
916
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
917
|
+
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
918
|
+
}
|
|
919
|
+
} else {
|
|
920
|
+
units = normalizeUnits(units);
|
|
921
|
+
if (isFunction(this[units])) {
|
|
922
|
+
return this[units](value);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
return this;
|
|
926
|
+
}
|
|
761
927
|
function mod(n, x) {
|
|
762
928
|
return (n % x + x) % x;
|
|
763
929
|
}
|
|
@@ -797,17 +963,9 @@ var moment$1 = {
|
|
|
797
963
|
return this.localeData().months(this, format);
|
|
798
964
|
});
|
|
799
965
|
|
|
800
|
-
// ALIASES
|
|
801
|
-
|
|
802
|
-
addUnitAlias('month', 'M');
|
|
803
|
-
|
|
804
|
-
// PRIORITY
|
|
805
|
-
|
|
806
|
-
addUnitPriority('month', 8);
|
|
807
|
-
|
|
808
966
|
// PARSING
|
|
809
967
|
|
|
810
|
-
addRegexToken('M', match1to2);
|
|
968
|
+
addRegexToken('M', match1to2, match1to2NoLeadingZero);
|
|
811
969
|
addRegexToken('MM', match1to2, match2);
|
|
812
970
|
addRegexToken('MMM', function (isStrict, locale) {
|
|
813
971
|
return locale.monthsShortRegex(isStrict);
|
|
@@ -928,7 +1086,6 @@ var moment$1 = {
|
|
|
928
1086
|
// MOMENTS
|
|
929
1087
|
|
|
930
1088
|
function setMonth(mom, value) {
|
|
931
|
-
var dayOfMonth;
|
|
932
1089
|
if (!mom.isValid()) {
|
|
933
1090
|
// No op
|
|
934
1091
|
return mom;
|
|
@@ -944,8 +1101,10 @@ var moment$1 = {
|
|
|
944
1101
|
}
|
|
945
1102
|
}
|
|
946
1103
|
}
|
|
947
|
-
|
|
948
|
-
|
|
1104
|
+
var month = value,
|
|
1105
|
+
date = mom.date();
|
|
1106
|
+
date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
|
|
1107
|
+
void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
|
|
949
1108
|
return mom;
|
|
950
1109
|
}
|
|
951
1110
|
function getSetMonth(value) {
|
|
@@ -1002,90 +1161,29 @@ var moment$1 = {
|
|
|
1002
1161
|
longPieces = [],
|
|
1003
1162
|
mixedPieces = [],
|
|
1004
1163
|
i,
|
|
1005
|
-
mom
|
|
1164
|
+
mom,
|
|
1165
|
+
shortP,
|
|
1166
|
+
longP;
|
|
1006
1167
|
for (i = 0; i < 12; i++) {
|
|
1007
1168
|
// make the regex if we don't have it already
|
|
1008
1169
|
mom = createUTC([2000, i]);
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1170
|
+
shortP = regexEscape(this.monthsShort(mom, ''));
|
|
1171
|
+
longP = regexEscape(this.months(mom, ''));
|
|
1172
|
+
shortPieces.push(shortP);
|
|
1173
|
+
longPieces.push(longP);
|
|
1174
|
+
mixedPieces.push(longP);
|
|
1175
|
+
mixedPieces.push(shortP);
|
|
1013
1176
|
}
|
|
1014
1177
|
// Sorting makes sure if one month (or abbr) is a prefix of another it
|
|
1015
1178
|
// will match the longer piece.
|
|
1016
1179
|
shortPieces.sort(cmpLenRev);
|
|
1017
1180
|
longPieces.sort(cmpLenRev);
|
|
1018
1181
|
mixedPieces.sort(cmpLenRev);
|
|
1019
|
-
for (i = 0; i < 12; i++) {
|
|
1020
|
-
shortPieces[i] = regexEscape(shortPieces[i]);
|
|
1021
|
-
longPieces[i] = regexEscape(longPieces[i]);
|
|
1022
|
-
}
|
|
1023
|
-
for (i = 0; i < 24; i++) {
|
|
1024
|
-
mixedPieces[i] = regexEscape(mixedPieces[i]);
|
|
1025
|
-
}
|
|
1026
1182
|
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
|
1027
1183
|
this._monthsShortRegex = this._monthsRegex;
|
|
1028
1184
|
this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
|
|
1029
1185
|
this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
|
|
1030
1186
|
}
|
|
1031
|
-
|
|
1032
|
-
// FORMATTING
|
|
1033
|
-
|
|
1034
|
-
addFormatToken('Y', 0, 0, function () {
|
|
1035
|
-
var y = this.year();
|
|
1036
|
-
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
|
|
1037
|
-
});
|
|
1038
|
-
addFormatToken(0, ['YY', 2], 0, function () {
|
|
1039
|
-
return this.year() % 100;
|
|
1040
|
-
});
|
|
1041
|
-
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
|
1042
|
-
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
|
1043
|
-
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
|
1044
|
-
|
|
1045
|
-
// ALIASES
|
|
1046
|
-
|
|
1047
|
-
addUnitAlias('year', 'y');
|
|
1048
|
-
|
|
1049
|
-
// PRIORITIES
|
|
1050
|
-
|
|
1051
|
-
addUnitPriority('year', 1);
|
|
1052
|
-
|
|
1053
|
-
// PARSING
|
|
1054
|
-
|
|
1055
|
-
addRegexToken('Y', matchSigned);
|
|
1056
|
-
addRegexToken('YY', match1to2, match2);
|
|
1057
|
-
addRegexToken('YYYY', match1to4, match4);
|
|
1058
|
-
addRegexToken('YYYYY', match1to6, match6);
|
|
1059
|
-
addRegexToken('YYYYYY', match1to6, match6);
|
|
1060
|
-
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
|
1061
|
-
addParseToken('YYYY', function (input, array) {
|
|
1062
|
-
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
|
1063
|
-
});
|
|
1064
|
-
addParseToken('YY', function (input, array) {
|
|
1065
|
-
array[YEAR] = hooks.parseTwoDigitYear(input);
|
|
1066
|
-
});
|
|
1067
|
-
addParseToken('Y', function (input, array) {
|
|
1068
|
-
array[YEAR] = parseInt(input, 10);
|
|
1069
|
-
});
|
|
1070
|
-
|
|
1071
|
-
// HELPERS
|
|
1072
|
-
|
|
1073
|
-
function daysInYear(year) {
|
|
1074
|
-
return isLeapYear(year) ? 366 : 365;
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
// HOOKS
|
|
1078
|
-
|
|
1079
|
-
hooks.parseTwoDigitYear = function (input) {
|
|
1080
|
-
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
|
1081
|
-
};
|
|
1082
|
-
|
|
1083
|
-
// MOMENTS
|
|
1084
|
-
|
|
1085
|
-
var getSetYear = makeGetSet('FullYear', true);
|
|
1086
|
-
function getIsLeapYear() {
|
|
1087
|
-
return isLeapYear(this.year());
|
|
1088
|
-
}
|
|
1089
1187
|
function createDate(y, m, d, h, M, s, ms) {
|
|
1090
1188
|
// can't just apply() to create a date:
|
|
1091
1189
|
// https://stackoverflow.com/q/181348
|
|
@@ -1182,21 +1280,11 @@ var moment$1 = {
|
|
|
1182
1280
|
addFormatToken('w', ['ww', 2], 'wo', 'week');
|
|
1183
1281
|
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
|
|
1184
1282
|
|
|
1185
|
-
// ALIASES
|
|
1186
|
-
|
|
1187
|
-
addUnitAlias('week', 'w');
|
|
1188
|
-
addUnitAlias('isoWeek', 'W');
|
|
1189
|
-
|
|
1190
|
-
// PRIORITIES
|
|
1191
|
-
|
|
1192
|
-
addUnitPriority('week', 5);
|
|
1193
|
-
addUnitPriority('isoWeek', 5);
|
|
1194
|
-
|
|
1195
1283
|
// PARSING
|
|
1196
1284
|
|
|
1197
|
-
addRegexToken('w', match1to2);
|
|
1285
|
+
addRegexToken('w', match1to2, match1to2NoLeadingZero);
|
|
1198
1286
|
addRegexToken('ww', match1to2, match2);
|
|
1199
|
-
addRegexToken('W', match1to2);
|
|
1287
|
+
addRegexToken('W', match1to2, match1to2NoLeadingZero);
|
|
1200
1288
|
addRegexToken('WW', match1to2, match2);
|
|
1201
1289
|
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
|
|
1202
1290
|
week[token.substr(0, 1)] = toInt(input);
|
|
@@ -1247,17 +1335,6 @@ var moment$1 = {
|
|
|
1247
1335
|
addFormatToken('e', 0, 0, 'weekday');
|
|
1248
1336
|
addFormatToken('E', 0, 0, 'isoWeekday');
|
|
1249
1337
|
|
|
1250
|
-
// ALIASES
|
|
1251
|
-
|
|
1252
|
-
addUnitAlias('day', 'd');
|
|
1253
|
-
addUnitAlias('weekday', 'e');
|
|
1254
|
-
addUnitAlias('isoWeekday', 'E');
|
|
1255
|
-
|
|
1256
|
-
// PRIORITY
|
|
1257
|
-
addUnitPriority('day', 11);
|
|
1258
|
-
addUnitPriority('weekday', 11);
|
|
1259
|
-
addUnitPriority('isoWeekday', 11);
|
|
1260
|
-
|
|
1261
1338
|
// PARSING
|
|
1262
1339
|
|
|
1263
1340
|
addRegexToken('d', match1to2);
|
|
@@ -1434,7 +1511,7 @@ var moment$1 = {
|
|
|
1434
1511
|
if (!this.isValid()) {
|
|
1435
1512
|
return input != null ? this : NaN;
|
|
1436
1513
|
}
|
|
1437
|
-
var day = this
|
|
1514
|
+
var day = get(this, 'Day');
|
|
1438
1515
|
if (input != null) {
|
|
1439
1516
|
input = parseWeekday(input, this.localeData());
|
|
1440
1517
|
return this.add(input - day, 'd');
|
|
@@ -1587,13 +1664,6 @@ var moment$1 = {
|
|
|
1587
1664
|
meridiem('a', true);
|
|
1588
1665
|
meridiem('A', false);
|
|
1589
1666
|
|
|
1590
|
-
// ALIASES
|
|
1591
|
-
|
|
1592
|
-
addUnitAlias('hour', 'h');
|
|
1593
|
-
|
|
1594
|
-
// PRIORITY
|
|
1595
|
-
addUnitPriority('hour', 13);
|
|
1596
|
-
|
|
1597
1667
|
// PARSING
|
|
1598
1668
|
|
|
1599
1669
|
function matchMeridiem(isStrict, locale) {
|
|
@@ -1601,9 +1671,9 @@ var moment$1 = {
|
|
|
1601
1671
|
}
|
|
1602
1672
|
addRegexToken('a', matchMeridiem);
|
|
1603
1673
|
addRegexToken('A', matchMeridiem);
|
|
1604
|
-
addRegexToken('H', match1to2);
|
|
1605
|
-
addRegexToken('h', match1to2);
|
|
1606
|
-
addRegexToken('k', match1to2);
|
|
1674
|
+
addRegexToken('H', match1to2, match1to2HasZero);
|
|
1675
|
+
addRegexToken('h', match1to2, match1to2NoLeadingZero);
|
|
1676
|
+
addRegexToken('k', match1to2, match1to2NoLeadingZero);
|
|
1607
1677
|
addRegexToken('HH', match1to2, match2);
|
|
1608
1678
|
addRegexToken('hh', match1to2, match2);
|
|
1609
1679
|
addRegexToken('kk', match1to2, match2);
|
|
@@ -1736,7 +1806,8 @@ var moment$1 = {
|
|
|
1736
1806
|
}
|
|
1737
1807
|
function isLocaleNameSane(name) {
|
|
1738
1808
|
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
|
1739
|
-
|
|
1809
|
+
// Ensure name is available and function returns boolean
|
|
1810
|
+
return !!(name && name.match('^[^/\\\\]*$'));
|
|
1740
1811
|
}
|
|
1741
1812
|
function loadLocale(name) {
|
|
1742
1813
|
var oldLocale = null,
|
|
@@ -3631,14 +3702,20 @@ var moment$1 = {
|
|
|
3631
3702
|
mixedPieces = [],
|
|
3632
3703
|
i,
|
|
3633
3704
|
l,
|
|
3705
|
+
erasName,
|
|
3706
|
+
erasAbbr,
|
|
3707
|
+
erasNarrow,
|
|
3634
3708
|
eras = this.eras();
|
|
3635
3709
|
for (i = 0, l = eras.length; i < l; ++i) {
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3710
|
+
erasName = regexEscape(eras[i].name);
|
|
3711
|
+
erasAbbr = regexEscape(eras[i].abbr);
|
|
3712
|
+
erasNarrow = regexEscape(eras[i].narrow);
|
|
3713
|
+
namePieces.push(erasName);
|
|
3714
|
+
abbrPieces.push(erasAbbr);
|
|
3715
|
+
narrowPieces.push(erasNarrow);
|
|
3716
|
+
mixedPieces.push(erasName);
|
|
3717
|
+
mixedPieces.push(erasAbbr);
|
|
3718
|
+
mixedPieces.push(erasNarrow);
|
|
3642
3719
|
}
|
|
3643
3720
|
this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
|
3644
3721
|
this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
|
|
@@ -3664,14 +3741,6 @@ var moment$1 = {
|
|
|
3664
3741
|
|
|
3665
3742
|
// ALIASES
|
|
3666
3743
|
|
|
3667
|
-
addUnitAlias('weekYear', 'gg');
|
|
3668
|
-
addUnitAlias('isoWeekYear', 'GG');
|
|
3669
|
-
|
|
3670
|
-
// PRIORITY
|
|
3671
|
-
|
|
3672
|
-
addUnitPriority('weekYear', 1);
|
|
3673
|
-
addUnitPriority('isoWeekYear', 1);
|
|
3674
|
-
|
|
3675
3744
|
// PARSING
|
|
3676
3745
|
|
|
3677
3746
|
addRegexToken('G', matchSigned);
|
|
@@ -3692,7 +3761,7 @@ var moment$1 = {
|
|
|
3692
3761
|
// MOMENTS
|
|
3693
3762
|
|
|
3694
3763
|
function getSetWeekYear(input) {
|
|
3695
|
-
return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);
|
|
3764
|
+
return getSetWeekYearHelper.call(this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy);
|
|
3696
3765
|
}
|
|
3697
3766
|
function getSetISOWeekYear(input) {
|
|
3698
3767
|
return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
|
|
@@ -3736,14 +3805,6 @@ var moment$1 = {
|
|
|
3736
3805
|
|
|
3737
3806
|
addFormatToken('Q', 0, 'Qo', 'quarter');
|
|
3738
3807
|
|
|
3739
|
-
// ALIASES
|
|
3740
|
-
|
|
3741
|
-
addUnitAlias('quarter', 'Q');
|
|
3742
|
-
|
|
3743
|
-
// PRIORITY
|
|
3744
|
-
|
|
3745
|
-
addUnitPriority('quarter', 7);
|
|
3746
|
-
|
|
3747
3808
|
// PARSING
|
|
3748
3809
|
|
|
3749
3810
|
addRegexToken('Q', match1);
|
|
@@ -3761,16 +3822,9 @@ var moment$1 = {
|
|
|
3761
3822
|
|
|
3762
3823
|
addFormatToken('D', ['DD', 2], 'Do', 'date');
|
|
3763
3824
|
|
|
3764
|
-
// ALIASES
|
|
3765
|
-
|
|
3766
|
-
addUnitAlias('date', 'D');
|
|
3767
|
-
|
|
3768
|
-
// PRIORITY
|
|
3769
|
-
addUnitPriority('date', 9);
|
|
3770
|
-
|
|
3771
3825
|
// PARSING
|
|
3772
3826
|
|
|
3773
|
-
addRegexToken('D', match1to2);
|
|
3827
|
+
addRegexToken('D', match1to2, match1to2NoLeadingZero);
|
|
3774
3828
|
addRegexToken('DD', match1to2, match2);
|
|
3775
3829
|
addRegexToken('Do', function (isStrict, locale) {
|
|
3776
3830
|
// TODO: Remove "ordinalParse" fallback in next major release.
|
|
@@ -3789,13 +3843,6 @@ var moment$1 = {
|
|
|
3789
3843
|
|
|
3790
3844
|
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
|
|
3791
3845
|
|
|
3792
|
-
// ALIASES
|
|
3793
|
-
|
|
3794
|
-
addUnitAlias('dayOfYear', 'DDD');
|
|
3795
|
-
|
|
3796
|
-
// PRIORITY
|
|
3797
|
-
addUnitPriority('dayOfYear', 4);
|
|
3798
|
-
|
|
3799
3846
|
// PARSING
|
|
3800
3847
|
|
|
3801
3848
|
addRegexToken('DDD', match1to3);
|
|
@@ -3817,17 +3864,9 @@ var moment$1 = {
|
|
|
3817
3864
|
|
|
3818
3865
|
addFormatToken('m', ['mm', 2], 0, 'minute');
|
|
3819
3866
|
|
|
3820
|
-
// ALIASES
|
|
3821
|
-
|
|
3822
|
-
addUnitAlias('minute', 'm');
|
|
3823
|
-
|
|
3824
|
-
// PRIORITY
|
|
3825
|
-
|
|
3826
|
-
addUnitPriority('minute', 14);
|
|
3827
|
-
|
|
3828
3867
|
// PARSING
|
|
3829
3868
|
|
|
3830
|
-
addRegexToken('m', match1to2);
|
|
3869
|
+
addRegexToken('m', match1to2, match1to2HasZero);
|
|
3831
3870
|
addRegexToken('mm', match1to2, match2);
|
|
3832
3871
|
addParseToken(['m', 'mm'], MINUTE);
|
|
3833
3872
|
|
|
@@ -3839,17 +3878,9 @@ var moment$1 = {
|
|
|
3839
3878
|
|
|
3840
3879
|
addFormatToken('s', ['ss', 2], 0, 'second');
|
|
3841
3880
|
|
|
3842
|
-
// ALIASES
|
|
3843
|
-
|
|
3844
|
-
addUnitAlias('second', 's');
|
|
3845
|
-
|
|
3846
|
-
// PRIORITY
|
|
3847
|
-
|
|
3848
|
-
addUnitPriority('second', 15);
|
|
3849
|
-
|
|
3850
3881
|
// PARSING
|
|
3851
3882
|
|
|
3852
|
-
addRegexToken('s', match1to2);
|
|
3883
|
+
addRegexToken('s', match1to2, match1to2HasZero);
|
|
3853
3884
|
addRegexToken('ss', match1to2, match2);
|
|
3854
3885
|
addParseToken(['s', 'ss'], SECOND);
|
|
3855
3886
|
|
|
@@ -3885,14 +3916,6 @@ var moment$1 = {
|
|
|
3885
3916
|
return this.millisecond() * 1000000;
|
|
3886
3917
|
});
|
|
3887
3918
|
|
|
3888
|
-
// ALIASES
|
|
3889
|
-
|
|
3890
|
-
addUnitAlias('millisecond', 'ms');
|
|
3891
|
-
|
|
3892
|
-
// PRIORITY
|
|
3893
|
-
|
|
3894
|
-
addUnitPriority('millisecond', 16);
|
|
3895
|
-
|
|
3896
3919
|
// PARSING
|
|
3897
3920
|
|
|
3898
3921
|
addRegexToken('S', match1to3, match1);
|
|
@@ -4285,14 +4308,6 @@ var moment$1 = {
|
|
|
4285
4308
|
}
|
|
4286
4309
|
}
|
|
4287
4310
|
}
|
|
4288
|
-
|
|
4289
|
-
// TODO: Use this.as('ms')?
|
|
4290
|
-
function valueOf$1() {
|
|
4291
|
-
if (!this.isValid()) {
|
|
4292
|
-
return NaN;
|
|
4293
|
-
}
|
|
4294
|
-
return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
|
|
4295
|
-
}
|
|
4296
4311
|
function makeAs(alias) {
|
|
4297
4312
|
return function () {
|
|
4298
4313
|
return this.as(alias);
|
|
@@ -4306,7 +4321,8 @@ var moment$1 = {
|
|
|
4306
4321
|
asWeeks = makeAs('w'),
|
|
4307
4322
|
asMonths = makeAs('M'),
|
|
4308
4323
|
asQuarters = makeAs('Q'),
|
|
4309
|
-
asYears = makeAs('y')
|
|
4324
|
+
asYears = makeAs('y'),
|
|
4325
|
+
valueOf$1 = asMilliseconds;
|
|
4310
4326
|
function clone$1() {
|
|
4311
4327
|
return createDuration(this);
|
|
4312
4328
|
}
|
|
@@ -4529,7 +4545,7 @@ var moment$1 = {
|
|
|
4529
4545
|
|
|
4530
4546
|
//! moment.js
|
|
4531
4547
|
|
|
4532
|
-
hooks.version = '2.
|
|
4548
|
+
hooks.version = '2.30.1';
|
|
4533
4549
|
setHookCallback(createLocal);
|
|
4534
4550
|
hooks.fn = proto;
|
|
4535
4551
|
hooks.min = min;
|
|
@@ -6142,7 +6158,7 @@ var FocusLock$1 = /*#__PURE__*/React__namespace.forwardRef(function FocusLockUI(
|
|
|
6142
6158
|
var hasLeadingGuards = noFocusGuards !== true;
|
|
6143
6159
|
var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';
|
|
6144
6160
|
var mergedRef = useMergeRefs([parentRef, setObserveNode]);
|
|
6145
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, hasLeadingGuards && [
|
|
6161
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, hasLeadingGuards && [/*#__PURE__*/
|
|
6146
6162
|
// nearest focus guard
|
|
6147
6163
|
React__namespace.createElement("div", {
|
|
6148
6164
|
key: "guard-first",
|
|
@@ -9103,7 +9119,8 @@ function RecurringDates(props) {
|
|
|
9103
9119
|
defaultRecurrences,
|
|
9104
9120
|
hideEndDate,
|
|
9105
9121
|
hideCustom,
|
|
9106
|
-
dateTimeOptions
|
|
9122
|
+
dateTimeOptions,
|
|
9123
|
+
dateOnly
|
|
9107
9124
|
} = {
|
|
9108
9125
|
...pluginConfig,
|
|
9109
9126
|
...options
|
|
@@ -9147,6 +9164,21 @@ function RecurringDates(props) {
|
|
|
9147
9164
|
...dateTimeOptions
|
|
9148
9165
|
};
|
|
9149
9166
|
}
|
|
9167
|
+
if (dateOnly === true) {
|
|
9168
|
+
if ((startDateMember == null ? void 0 : startDateMember.kind) == "field") {
|
|
9169
|
+
startDateMember.field.schemaType.name = "date";
|
|
9170
|
+
}
|
|
9171
|
+
if ((endDateMember == null ? void 0 : endDateMember.kind) == "field") {
|
|
9172
|
+
endDateMember.field.schemaType.name = "date";
|
|
9173
|
+
}
|
|
9174
|
+
} else {
|
|
9175
|
+
if ((startDateMember == null ? void 0 : startDateMember.kind) == "field") {
|
|
9176
|
+
startDateMember.field.schemaType.name = "datetime";
|
|
9177
|
+
}
|
|
9178
|
+
if ((endDateMember == null ? void 0 : endDateMember.kind) == "field") {
|
|
9179
|
+
endDateMember.field.schemaType.name = "datetime";
|
|
9180
|
+
}
|
|
9181
|
+
}
|
|
9150
9182
|
const hasEndDate = currentValue && currentValue.endDate;
|
|
9151
9183
|
return /* @__PURE__ */jsxRuntime.jsxs(ui.Stack, {
|
|
9152
9184
|
space: 3,
|
|
@@ -9221,7 +9253,8 @@ function RecurringDates(props) {
|
|
|
9221
9253
|
}
|
|
9222
9254
|
var recurringDateSchema = config => {
|
|
9223
9255
|
const {
|
|
9224
|
-
dateTimeOptions
|
|
9256
|
+
dateTimeOptions,
|
|
9257
|
+
dateOnly
|
|
9225
9258
|
} = config;
|
|
9226
9259
|
return sanity.defineField({
|
|
9227
9260
|
name: "recurringDates",
|
|
@@ -9230,13 +9263,13 @@ var recurringDateSchema = config => {
|
|
|
9230
9263
|
fields: [sanity.defineField({
|
|
9231
9264
|
title: "Start Date",
|
|
9232
9265
|
name: "startDate",
|
|
9233
|
-
type: "datetime",
|
|
9266
|
+
type: dateOnly ? "date" : "datetime",
|
|
9234
9267
|
options: dateTimeOptions,
|
|
9235
9268
|
validation: Rule => Rule.required()
|
|
9236
9269
|
}), sanity.defineField({
|
|
9237
9270
|
title: "End Date",
|
|
9238
9271
|
name: "endDate",
|
|
9239
|
-
type: "datetime",
|
|
9272
|
+
type: dateOnly ? "date" : "datetime",
|
|
9240
9273
|
options: dateTimeOptions,
|
|
9241
9274
|
validation: Rule => Rule.min(Rule.valueOfField("startDate"))
|
|
9242
9275
|
}), sanity.defineField({
|