tpmkms_4wp 9.3.0-beta.43 → 9.3.0-beta.45
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/crew.instance.json +36 -0
- package/common/dateTimeSelectors.js +6 -2
- package/common/dateTimeSelectors.test.json +51285 -12
- package/common/dates.instance.json +25 -1
- package/common/dates.js +4 -0
- package/common/dates.test.json +1992 -0
- package/common/fastfood.instance.json +275 -175
- package/common/helpers/dateTimeSelectors.js +43 -1
- package/common/reminders.instance.json +1 -1
- package/common/reminders.test.json +3371 -26
- package/common/reports.instance.json +1 -1
- package/package.json +2 -2
@@ -30,6 +30,35 @@ function getNextDayOfWeek(date, targetDay) {
|
|
30
30
|
return nextDate;
|
31
31
|
}
|
32
32
|
|
33
|
+
function toMonthNumber(value) {
|
34
|
+
const map = {
|
35
|
+
"jan_dates": 1,
|
36
|
+
"feb_dates": 2,
|
37
|
+
"mar_dates": 3,
|
38
|
+
"apr_dates": 4,
|
39
|
+
"may_dates": 5,
|
40
|
+
"jun_dates": 6,
|
41
|
+
"jul_dates": 7,
|
42
|
+
"aug_dates": 8,
|
43
|
+
"sept_dates": 9,
|
44
|
+
"oct_dates": 10,
|
45
|
+
"nov_dates": 11,
|
46
|
+
"dec_dates": 12,
|
47
|
+
"january_dates": 1,
|
48
|
+
"february_dates": 2,
|
49
|
+
"march_dates": 3,
|
50
|
+
"april_dates": 4,
|
51
|
+
"june_dates": 6,
|
52
|
+
"july_dates": 7,
|
53
|
+
"august_dates": 8,
|
54
|
+
"september_dates": 9,
|
55
|
+
"october_dates": 10,
|
56
|
+
"november_dates": 11,
|
57
|
+
"december_dates": 12,
|
58
|
+
}
|
59
|
+
return map[value]
|
60
|
+
}
|
61
|
+
|
33
62
|
function getTime(time) {
|
34
63
|
let hour = 0
|
35
64
|
const minute = 0
|
@@ -57,7 +86,20 @@ function getTime(time) {
|
|
57
86
|
}
|
58
87
|
|
59
88
|
instantiate = (isA, now, context) => {
|
60
|
-
|
89
|
+
debugger
|
90
|
+
if (
|
91
|
+
(context.marker == 'onDate_dates' && context.date?.marker == 'monthDayYear_dates') ||
|
92
|
+
(context.marker == 'monthDayYear_dates')
|
93
|
+
) {
|
94
|
+
if (context.marker == 'onDate_dates') {
|
95
|
+
context = context.date
|
96
|
+
}
|
97
|
+
const day = context.day.value;
|
98
|
+
const month = toMonthNumber(context.month.value);
|
99
|
+
const year = context.year.value;
|
100
|
+
const date = new Date(year, month-1, day)
|
101
|
+
return date.toISOString()
|
102
|
+
} else if (isA(context?.marker, 'dateTimeSelector')) {
|
61
103
|
// (on date) OR (date)
|
62
104
|
const date = context.date?.date || context.date
|
63
105
|
const dateTimeSelector = getNextDayOfWeek(now, date.value)
|
@@ -69,7 +69,7 @@
|
|
69
69
|
"convolution": true,
|
70
70
|
"disabled": true,
|
71
71
|
"bridge": "{ ...next(operator), operator: operator, reminder: after[0], date: after[1], interpolate: '${reminder} ${date}' }",
|
72
|
-
"semantic": "async ({context, api, gp, gsp}) => {\n const text = await gsp(context.reminder.slice(
|
72
|
+
"semantic": "async ({context, api, gp, gsp}) => {\n const text = await gsp(context.reminder.slice(0));\n const update = { text }\n if (context.date) {\n update.dateTimeSelector = context.date\n update.dateTimeSelectorText = await gp(context.date)\n }\n await api.update(update)\n }"
|
73
73
|
},
|
74
74
|
{
|
75
75
|
"id": "remind",
|