tpmkms_4wp 9.3.0-beta.47 → 9.3.0-beta.48
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/common/dateTimeSelectors.js +15 -5
- package/common/dateTimeSelectors.test.json +5160 -0
- package/common/reminders.test.json +4313 -0
- package/package.json +2 -2
@@ -39,6 +39,15 @@ function removeDatesSuffix(str) {
|
|
39
39
|
return str;
|
40
40
|
}
|
41
41
|
|
42
|
+
function onOrIs(marker, context) {
|
43
|
+
if (context.marker === marker) {
|
44
|
+
return context
|
45
|
+
}
|
46
|
+
if (context.marker === 'onDate_dates' && context.date?.marker == marker) {
|
47
|
+
return context.date
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
42
51
|
const template = {
|
43
52
|
configs: [
|
44
53
|
{
|
@@ -50,7 +59,8 @@ const template = {
|
|
50
59
|
{
|
51
60
|
id: 'dayOfMonth',
|
52
61
|
after: ['preposition'],
|
53
|
-
|
62
|
+
isA: ['onDateValue_dates'],
|
63
|
+
before: ['verb', 'onDate_dates'],
|
54
64
|
bridge: "{ ...next(operator), day: before[0], month: after[0], operator: operator, interpolate: '${day} ${operator} ${month}' }",
|
55
65
|
},
|
56
66
|
{
|
@@ -64,13 +74,13 @@ const template = {
|
|
64
74
|
],
|
65
75
|
semantics: [
|
66
76
|
{
|
67
|
-
|
68
|
-
match: ({context, isA}) => context.evaluate && context.marker === 'dayOfMonth',
|
77
|
+
match: ({context, isA}) => context.evaluate && onOrIs('dayOfMonth', context),
|
69
78
|
apply: ({context, isProcess, isTest, kms, isA}) => {
|
70
|
-
debugger
|
71
79
|
try {
|
72
80
|
const now = kms.time.api.now()
|
73
|
-
|
81
|
+
const date = onOrIs('dayOfMonth', context)
|
82
|
+
debugger
|
83
|
+
context.evalue = dateTimeSelectors_helpers.getNthDayOfMonth(removeDatesSuffix(date.day.value), date.day.ordinal.value || 1, removeDatesSuffix(date.month.value), now)
|
74
84
|
} catch ( e ) {
|
75
85
|
context.evalue = `Implement instatiate for this type of date. See the dateTimeSelectors KM ${where()}. ${e}`
|
76
86
|
}
|