-
Notifications
You must be signed in to change notification settings - Fork 0
/
when.re.js
343 lines (313 loc) · 8.97 KB
/
when.re.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
;
~
{ re:
{ id: '[email protected]'
, as: ['calendar', 'date', 'time', 'instantiation', 'specification']
, by: ['🙇🏾♂️ יהוה 🤲🏾', 'mike.🇬🇾👨🏾💻🇺🇸.lee', 'team✨baramita']
, on: -5.20020705
, to: -8.20221211
, at: -0.022
, in:
[ 'queens.ny.us.earth'
, 'silicon-valley.ca.us.earth'
],
is:
[ "an ordinal calendar date & time format specification"
, "the base spec for when@ timezoned, epoched, calendared & gregorian specs"
, "calendar, date, time & timezone within a decimal numeral"
],
we:
[ "have {format:'some(thing)[else]'} where ...(...) =required [...] =optional"
, "know that when@ well represents numeric date-time versus ecmascript.Date"
+ " : more date & time details in same number of digits; i.e. timezone offset"
+ " : numeric natural language discernable date-time format"
+ " : near precise milliseconds: to hundreds & tens vs hundreds, tens & ones"
+ " : can specify calendar type, timezone offset & date"
+ " : enables more intuitive & accurate mathematical date & time comparison"
+ " : can represent earth-star moments up to ones-place billions of years"
+ " : can represent existence moments up to tens-place trillions of years"
, "want when@ implementations to keep their [+-] signed direction then"
+ " convert to +when@ so each sub-attribute, e.g. minute, month & calendar-id"
+ " will be +positive when parsed, with direction later applied where needed"
, "will implement an ecmascript getter for attribute.values.current that'll"
+ " lookup|calculate & provide the attribute's current [local] host"
+ " environment value"
, "like renaming when@ 'instant' if any future naming conflicts|needs occur"
, "like that moments can be defined with custom epochs, year-size & more e.g:"
+ " Hebrew moments as date-time since God created us & our world"
+ " Igbo moments as 4-day, 7-week & 13-month cycles"
+ " Japanese moments as year(s) of a given emperor"
+ " Gregorian moments as date-time BC & AD"
+ " Mayan moments as varying multi & intra-year cycles"
+ " Stardate moments as star trek's imaginary stardates"
+ " Big-Bang moments as date-time observance of light's existence"
]
},
when:
{ format: null
, detail:
[ "observer's perception of when an instant occurs"
]
, type: "number"
, signed: true
, digits: 46 || 8+17+3*7
, values:
{ minimum: null
, current: null || "live value in [local] host environment"
, maximum: null
}
},
timezone:
{ format: "offset-hour[offset-minute]"
, detail: "relative to calendar's base timezone; e.g. gregorian utc 00:00"
, type: "number"
, signed: true
, digits: 4
, values:
{ minimum: -9999
, current: null || "live value in [local] host environment"
, maximum: +9999
}
},
"offset-hour":
{ detail:
[ "timezone's offset in hours; earth: 0..14, max earth hour is 23"
, "must be 1 digit if less than 10 to ensure interpreted as a decimal number"
]
, type: "number"
, signed: true
, digits: 2
, values:
{ minimum: 0
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
"offset-minute":
{ detail: "timezone's offset in minutes, optional if 00; earth: 00, 15, 30, 45"
, type: "number"
, signed: true
, digits: 2
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
calendar:
{ format: "calendar-id(calendar-version)"
, detail: "identifies a specific & unique [revised] calendar among all known"
, type: "number"
, digits: 4
, values:
{ minimum: 0000
, current: null || "live value in [local] host environment"
, maximum: 9999
}
},
"calendar-id":
{ detail: "unique # for 1 of all known calendar types, e.g. hebrew, gregorian, etc."
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
"calendar-version":
{ detail: "unique revision of 1 specific type of calendar, e.g. hebrew version 2"
, type: "number"
, digits: 1
, values:
{ minimum: 0
, current: null || "live value in [local] host environment"
, maximum: 9
}
},
"year-date-time":
{ format: "date[time]"
, detail:
[ "observer's perception of when, within a cosmic configuration cycle"
, " e.g. earth: year, month, day, hour, minute, second, sub-second"
]
, type: "number"
, digits: 38 || 17+3*7
, values:
{ minimum: null
, current: null || "live value in [local] host environment"
, maximum: 99999999999999999999999999999999999999n
}
},
date:
{ format: "year[month[day]]"
, type: "number"
, digits: 8 || 4+2+2
, values:
{ minimum: null
, current: null || "live value in [local] host environment"
, maximum: 99999999
}
},
year:
{ type: "number"
, digits: 4
, values:
{ minimum: null
, current: null || "live value in [local] host environment"
, maximum: 9999
}
},
month:
{ detail: "earth: 01..12"
, type: "number"
, digits: 2
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
day:
{ detail: "earth: 01..31"
, type: "number"
, digits: 2
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
time:
{ format: "hour[minute[second[sub-second]]]"
, type: "number"
, digits: 30
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 999999999999999999999999999999n
}
},
hour:
{ detail: "earth: 00..23"
, type: "number"
, digits: 2
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
minute:
{ detail: "earth: 00..59"
, type: "number"
, digits: 2
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
second:
{ detail: "earth: 00..59"
, type: "number"
, digits: 2
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 99
}
},
"sub-second":
{ format: "ms[mcs[ns[ps[fs[as[zs[ys]]]]]]]"
, detail: "milli[micro[nano[pico[femto[atto[zepto[yocto]]]]]]"
, type: "number"
, digits: 24
, values:
{ minimum: 00
, current: null || "live value in [local] host environment"
, maximum: 999999999999999999999999n
}
},
ms:
{ detail: "millisecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
mcs:
{ detail: "microsecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
ns:
{ detail: "nanosecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
ps:
{ detail: "picosecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
fs:
{ detail: "femtosecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
as:
{ detail: "attosecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
zs:
{ detail: "zeptosecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
},
ys:
{ detail: "yoctosecond"
, type: "number"
, digits: 3
, values:
{ minimum: 000
, current: null || "live value in [local] host environment"
, maximum: 999
}
}
}
;