tpmkms_4wp 9.3.0-beta.49 → 9.3.0-beta.50
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 +31 -1
- package/common/dateTimeSelectors.test.json +7934 -65
- package/common/dates.instance.json +70 -101
- package/common/dates.js +15 -2
- package/common/dates.test.json +2002 -0
- package/package.json +2 -2
@@ -48,21 +48,38 @@ function onOrIs(marker, context) {
|
|
48
48
|
}
|
49
49
|
}
|
50
50
|
|
51
|
+
function afterOrIs(marker, context) {
|
52
|
+
if (context.marker === marker) {
|
53
|
+
return context
|
54
|
+
}
|
55
|
+
if (context.marker === 'afterDate_dates' && context.date?.marker == marker) {
|
56
|
+
return context.date
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
51
60
|
const template = {
|
52
61
|
configs: [
|
53
62
|
{
|
54
63
|
operators: [
|
55
64
|
"([dateTimeSelector] (onDate) (atTime))",
|
56
65
|
"((day_dates/*) [dayOfMonth|of] (month_dates/*))",
|
66
|
+
"((day_dates/*) [dayAfterDate|after] (afterDateValue_dates/*))",
|
57
67
|
],
|
58
68
|
bridges: [
|
59
69
|
{
|
60
70
|
id: 'dayOfMonth',
|
61
|
-
after: ['
|
71
|
+
after: ['article'],
|
62
72
|
isA: ['onDateValue_dates'],
|
63
73
|
before: ['verb', 'onDate_dates'],
|
64
74
|
bridge: "{ ...next(operator), day: before[0], month: after[0], operator: operator, interpolate: '${day} ${operator} ${month}' }",
|
65
75
|
},
|
76
|
+
{
|
77
|
+
id: 'dayAfterDate',
|
78
|
+
after: ['article', 'monthDayYear_dates'],
|
79
|
+
isA: ['afterDateValue_dates'],
|
80
|
+
before: ['verb', 'afterDate_dates'],
|
81
|
+
bridge: "{ ...next(operator), day: before[0], after: after[0], operator: operator, interpolate: '${day} ${operator} ${after}' }",
|
82
|
+
},
|
66
83
|
{
|
67
84
|
id: 'dateTimeSelector',
|
68
85
|
after: ['preposition'],
|
@@ -73,6 +90,19 @@ const template = {
|
|
73
90
|
},
|
74
91
|
],
|
75
92
|
semantics: [
|
93
|
+
{
|
94
|
+
match: ({context, isA}) => context.evaluate && onOrIs('dayAfterDate', context),
|
95
|
+
apply: ({context, isProcess, isTest, kms, isA}) => {
|
96
|
+
try {
|
97
|
+
const now = kms.time.api.now()
|
98
|
+
debugger
|
99
|
+
const date = afterOrIs('dayOfMonth', context)
|
100
|
+
context.evalue = dateTimeSelectors_helpers.getNthDayOfMonth(removeDatesSuffix(date.day.value), date.day.ordinal.value || 1, removeDatesSuffix(date.month.value), now)
|
101
|
+
} catch ( e ) {
|
102
|
+
context.evalue = `Implement instatiate for this type of date. See the dateTimeSelectors KM ${where()}. ${e}`
|
103
|
+
}
|
104
|
+
},
|
105
|
+
},
|
76
106
|
{
|
77
107
|
match: ({context, isA}) => context.evaluate && onOrIs('dayOfMonth', context),
|
78
108
|
apply: ({context, isProcess, isTest, kms, isA}) => {
|