firefly-compiler 0.5.48 → 0.5.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/bin/firefly.mjs +1 -1
- package/compiler/Compiler.ff +1 -1
- package/core/BrowserSystem.ff +5 -0
- package/core/Date.ff +623 -0
- package/core/Instant.ff +0 -24
- package/core/JsValue.ff +1 -1
- package/core/Map.ff +8 -0
- package/core/NodeSystem.ff +5 -0
- package/core/Path.ff +2 -2
- package/core/Random.ff +0 -4
- package/core/RbMap.ff +16 -0
- package/core/Set.ff +3 -1
- package/core/Task.ff +0 -4
- package/experimental/tests/TestDate.ff +10 -0
- package/experimental/tests/TestEmailAlertDateLogic.ff +84 -0
- package/firefly.sh +5 -5
- package/output/js/ff/compiler/Builder.mjs +2 -2
- package/output/js/ff/compiler/Compiler.mjs +3 -3
- package/output/js/ff/compiler/Dependencies.mjs +2 -2
- package/output/js/ff/compiler/DependencyLock.mjs +2 -2
- package/output/js/ff/compiler/Deriver.mjs +2 -2
- package/output/js/ff/compiler/Dictionaries.mjs +2 -2
- package/output/js/ff/compiler/Environment.mjs +2 -2
- package/output/js/ff/compiler/Inference.mjs +2 -2
- package/output/js/ff/compiler/JsEmitter.mjs +2 -2
- package/output/js/ff/compiler/JsImporter.mjs +2 -2
- package/output/js/ff/compiler/LspHook.mjs +2 -2
- package/output/js/ff/compiler/Main.mjs +2 -2
- package/output/js/ff/compiler/ModuleCache.mjs +2 -2
- package/output/js/ff/compiler/Parser.mjs +2 -2
- package/output/js/ff/compiler/Patterns.mjs +2 -2
- package/output/js/ff/compiler/Resolver.mjs +2 -2
- package/output/js/ff/compiler/Substitution.mjs +2 -2
- package/output/js/ff/compiler/Syntax.mjs +2 -2
- package/output/js/ff/compiler/Token.mjs +2 -2
- package/output/js/ff/compiler/Tokenizer.mjs +2 -2
- package/output/js/ff/compiler/Unification.mjs +2 -2
- package/output/js/ff/compiler/Wildcards.mjs +2 -2
- package/output/js/ff/compiler/Workspace.mjs +2 -2
- package/output/js/ff/core/Any.mjs +2 -2
- package/output/js/ff/core/Array.mjs +2 -2
- package/output/js/ff/core/AssetSystem.mjs +2 -2
- package/output/js/ff/core/Atomic.mjs +2 -2
- package/output/js/ff/core/Bool.mjs +2 -2
- package/output/js/ff/core/BrowserSystem.mjs +28 -2
- package/output/js/ff/core/Buffer.mjs +2 -2
- package/output/js/ff/core/BuildSystem.mjs +2 -2
- package/output/js/ff/core/Channel.mjs +2 -2
- package/output/js/ff/core/Char.mjs +2 -2
- package/output/js/ff/core/Core.mjs +2 -2
- package/output/js/ff/core/Crypto.mjs +2 -2
- package/output/js/ff/core/Date.mjs +1009 -0
- package/output/js/ff/core/Duration.mjs +2 -2
- package/output/js/ff/core/Equal.mjs +2 -2
- package/output/js/ff/core/Error.mjs +2 -2
- package/output/js/ff/core/FileHandle.mjs +2 -2
- package/output/js/ff/core/Float.mjs +2 -2
- package/output/js/ff/core/HttpClient.mjs +2 -2
- package/output/js/ff/core/Int.mjs +2 -2
- package/output/js/ff/core/IntMap.mjs +2 -2
- package/output/js/ff/core/Js.mjs +2 -2
- package/output/js/ff/core/JsSystem.mjs +2 -2
- package/output/js/ff/core/JsValue.mjs +3 -3
- package/output/js/ff/core/Json.mjs +2 -2
- package/output/js/ff/core/List.mjs +2 -2
- package/output/js/ff/core/Lock.mjs +2 -2
- package/output/js/ff/core/Log.mjs +2 -2
- package/output/js/ff/core/Map.mjs +18 -2
- package/output/js/ff/core/NodeSystem.mjs +28 -2
- package/output/js/ff/core/Nothing.mjs +2 -2
- package/output/js/ff/core/Option.mjs +2 -2
- package/output/js/ff/core/Ordering.mjs +2 -2
- package/output/js/ff/core/Pair.mjs +2 -2
- package/output/js/ff/core/Path.mjs +4 -4
- package/output/js/ff/core/Queue.mjs +2 -2
- package/output/js/ff/core/Random.mjs +2 -10
- package/output/js/ff/core/RbMap.mjs +74 -2
- package/output/js/ff/core/Serializable.mjs +2 -2
- package/output/js/ff/core/Set.mjs +26 -2
- package/output/js/ff/core/Show.mjs +2 -2
- package/output/js/ff/core/SourceLocation.mjs +2 -2
- package/output/js/ff/core/Stream.mjs +2 -2
- package/output/js/ff/core/String.mjs +2 -2
- package/output/js/ff/core/StringMap.mjs +2 -2
- package/output/js/ff/core/Task.mjs +2 -10
- package/output/js/ff/core/Try.mjs +2 -2
- package/output/js/ff/core/Unit.mjs +2 -2
- package/package.json +1 -1
- package/postgresql/Pg.ff +0 -40
- package/s3/S3.ff +4 -4
- package/vscode/package.json +1 -1
- package/experimental/IfBug.ff +0 -8
- package/output/js/ff/core/Instant.mjs +0 -149
- /package/fireflysite/assets/markdown/scratch/{Toc.md → toc.md} +0 -0
|
@@ -0,0 +1,1009 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as ff_core_Any from "../../ff/core/Any.mjs"
|
|
4
|
+
|
|
5
|
+
import * as ff_core_Array from "../../ff/core/Array.mjs"
|
|
6
|
+
|
|
7
|
+
import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
|
|
8
|
+
|
|
9
|
+
import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
10
|
+
|
|
11
|
+
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
12
|
+
|
|
13
|
+
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
14
|
+
|
|
15
|
+
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
16
|
+
|
|
17
|
+
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
18
|
+
|
|
19
|
+
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
20
|
+
|
|
21
|
+
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
22
|
+
|
|
23
|
+
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
24
|
+
|
|
25
|
+
import * as ff_core_Crypto from "../../ff/core/Crypto.mjs"
|
|
26
|
+
|
|
27
|
+
import * as ff_core_Date from "../../ff/core/Date.mjs"
|
|
28
|
+
|
|
29
|
+
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
30
|
+
|
|
31
|
+
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
32
|
+
|
|
33
|
+
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
34
|
+
|
|
35
|
+
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
36
|
+
|
|
37
|
+
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
38
|
+
|
|
39
|
+
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
40
|
+
|
|
41
|
+
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
42
|
+
|
|
43
|
+
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
44
|
+
|
|
45
|
+
import * as ff_core_Js from "../../ff/core/Js.mjs"
|
|
46
|
+
|
|
47
|
+
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
48
|
+
|
|
49
|
+
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
50
|
+
|
|
51
|
+
import * as ff_core_Json from "../../ff/core/Json.mjs"
|
|
52
|
+
|
|
53
|
+
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
54
|
+
|
|
55
|
+
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
56
|
+
|
|
57
|
+
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
58
|
+
|
|
59
|
+
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
60
|
+
|
|
61
|
+
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
62
|
+
|
|
63
|
+
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
64
|
+
|
|
65
|
+
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
66
|
+
|
|
67
|
+
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
68
|
+
|
|
69
|
+
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
70
|
+
|
|
71
|
+
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
72
|
+
|
|
73
|
+
import * as ff_core_Queue from "../../ff/core/Queue.mjs"
|
|
74
|
+
|
|
75
|
+
import * as ff_core_Random from "../../ff/core/Random.mjs"
|
|
76
|
+
|
|
77
|
+
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
78
|
+
|
|
79
|
+
import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
80
|
+
|
|
81
|
+
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
82
|
+
|
|
83
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
|
+
|
|
85
|
+
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
86
|
+
|
|
87
|
+
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
88
|
+
|
|
89
|
+
import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
|
|
90
|
+
|
|
91
|
+
import * as ff_core_Task from "../../ff/core/Task.mjs"
|
|
92
|
+
|
|
93
|
+
import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
94
|
+
|
|
95
|
+
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
|
+
|
|
97
|
+
// newtype Date
|
|
98
|
+
|
|
99
|
+
// type DateGap
|
|
100
|
+
export function DateGap(years_, months_, weeks_, days_, hours_, minutes_, seconds_, milliseconds_, microseconds_, nanoseconds_) {
|
|
101
|
+
return {years_, months_, weeks_, days_, hours_, minutes_, seconds_, milliseconds_, microseconds_, nanoseconds_};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const utcTimeZoneId_ = "UTC";
|
|
105
|
+
|
|
106
|
+
export const isoCalendarId_ = "iso8601";
|
|
107
|
+
|
|
108
|
+
export const monday_ = 1;
|
|
109
|
+
|
|
110
|
+
export const tuesday_ = 2;
|
|
111
|
+
|
|
112
|
+
export const wednesday_ = 3;
|
|
113
|
+
|
|
114
|
+
export const thursday_ = 4;
|
|
115
|
+
|
|
116
|
+
export const friday_ = 5;
|
|
117
|
+
|
|
118
|
+
export const saturday_ = 6;
|
|
119
|
+
|
|
120
|
+
export const sunday_ = 7;
|
|
121
|
+
|
|
122
|
+
export const january_ = 1;
|
|
123
|
+
|
|
124
|
+
export const february_ = 2;
|
|
125
|
+
|
|
126
|
+
export const march_ = 3;
|
|
127
|
+
|
|
128
|
+
export const april_ = 4;
|
|
129
|
+
|
|
130
|
+
export const may_ = 5;
|
|
131
|
+
|
|
132
|
+
export const june_ = 6;
|
|
133
|
+
|
|
134
|
+
export const july_ = 7;
|
|
135
|
+
|
|
136
|
+
export const august_ = 8;
|
|
137
|
+
|
|
138
|
+
export const september_ = 9;
|
|
139
|
+
|
|
140
|
+
export const october_ = 10;
|
|
141
|
+
|
|
142
|
+
export const november_ = 11;
|
|
143
|
+
|
|
144
|
+
export const december_ = 12;
|
|
145
|
+
|
|
146
|
+
export function new_(timeZoneId_, year_, month_, day_, hour_ = 0, minute_ = 0, second_ = 0, millisecond_ = 0, microsecond_ = 0, nanosecond_ = 0, calendarId_ = "iso8601", offset_ = ff_core_Option.None(), earlier_ = true, later_ = true) {
|
|
147
|
+
return Temporal.ZonedDateTime.from({timeZone: timeZoneId_, year: year_, month: month_, day: day_, hour: hour_, minute: minute_, second: second_, millisecond: millisecond_, microsecond: microsecond_, nanosecond: nanosecond_, calendar: calendarId_, offset: ff_core_Option.Option_else(ff_core_Option.Option_map(offset_, ((_w1) => {
|
|
148
|
+
return _w1
|
|
149
|
+
})), (() => {
|
|
150
|
+
return (void 0)
|
|
151
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function newEra_(calendarId_, timeZoneId_, era_, eraYear_, month_, day_, hour_ = 0, minute_ = 0, second_ = 0, millisecond_ = 0, microsecond_ = 0, nanosecond_ = 0, offset_ = ff_core_Option.None(), earlier_ = true, later_ = true) {
|
|
155
|
+
return Temporal.ZonedDateTime.from({timeZone: timeZoneId_, era: era_, eraYear: eraYear_, month: month_, day: day_, hour: hour_, minute: minute_, second: second_, millisecond: millisecond_, microsecond: microsecond_, nanosecond: nanosecond_, calendar: calendarId_, offset: ff_core_Option.Option_else(ff_core_Option.Option_map(offset_, ((_w1) => {
|
|
156
|
+
return _w1
|
|
157
|
+
})), (() => {
|
|
158
|
+
return (void 0)
|
|
159
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function newEpochMilliseconds_(timeZoneId_, epochMilliseconds_, calendarId_ = "iso8601") {
|
|
163
|
+
const zoned_ = Temporal.Instant.fromEpochMilliseconds(epochMilliseconds_).toZonedDateTimeISO(timeZoneId_);
|
|
164
|
+
if((calendarId_ !== "iso8601")) {
|
|
165
|
+
return zoned_.withCalendar(calendarId_)
|
|
166
|
+
} else {
|
|
167
|
+
return zoned_
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function newRfc9557_(rfc9557_) {
|
|
172
|
+
return Temporal.ZonedDateTime.from(rfc9557_)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function gap_(iso8601_) {
|
|
176
|
+
const duration_ = Temporal.Duration.from(iso8601_);
|
|
177
|
+
return ff_core_Date.DateGap(duration_.years, duration_.months, duration_.weeks, duration_.days, duration_.hours, duration_.minutes, duration_.seconds, duration_.milliseconds, duration_.microseconds, duration_.nanoseconds)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function internalDisambiguation_(earlier_, later_) {
|
|
181
|
+
return {disambiguation: ((earlier_ && later_)
|
|
182
|
+
? "compatible"
|
|
183
|
+
: earlier_
|
|
184
|
+
? "earlier"
|
|
185
|
+
: later_
|
|
186
|
+
? "later"
|
|
187
|
+
: "reject")}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export async function new_$(timeZoneId_, year_, month_, day_, hour_ = 0, minute_ = 0, second_ = 0, millisecond_ = 0, microsecond_ = 0, nanosecond_ = 0, calendarId_ = "iso8601", offset_ = ff_core_Option.None(), earlier_ = true, later_ = true, $task) {
|
|
191
|
+
return Temporal.ZonedDateTime.from({timeZone: timeZoneId_, year: year_, month: month_, day: day_, hour: hour_, minute: minute_, second: second_, millisecond: millisecond_, microsecond: microsecond_, nanosecond: nanosecond_, calendar: calendarId_, offset: ff_core_Option.Option_else(ff_core_Option.Option_map(offset_, ((_w1) => {
|
|
192
|
+
return _w1
|
|
193
|
+
})), (() => {
|
|
194
|
+
return (void 0)
|
|
195
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export async function newEra_$(calendarId_, timeZoneId_, era_, eraYear_, month_, day_, hour_ = 0, minute_ = 0, second_ = 0, millisecond_ = 0, microsecond_ = 0, nanosecond_ = 0, offset_ = ff_core_Option.None(), earlier_ = true, later_ = true, $task) {
|
|
199
|
+
return Temporal.ZonedDateTime.from({timeZone: timeZoneId_, era: era_, eraYear: eraYear_, month: month_, day: day_, hour: hour_, minute: minute_, second: second_, millisecond: millisecond_, microsecond: microsecond_, nanosecond: nanosecond_, calendar: calendarId_, offset: ff_core_Option.Option_else(ff_core_Option.Option_map(offset_, ((_w1) => {
|
|
200
|
+
return _w1
|
|
201
|
+
})), (() => {
|
|
202
|
+
return (void 0)
|
|
203
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export async function newEpochMilliseconds_$(timeZoneId_, epochMilliseconds_, calendarId_ = "iso8601", $task) {
|
|
207
|
+
const zoned_ = Temporal.Instant.fromEpochMilliseconds(epochMilliseconds_).toZonedDateTimeISO(timeZoneId_);
|
|
208
|
+
if((calendarId_ !== "iso8601")) {
|
|
209
|
+
return zoned_.withCalendar(calendarId_)
|
|
210
|
+
} else {
|
|
211
|
+
return zoned_
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export async function newRfc9557_$(rfc9557_, $task) {
|
|
216
|
+
return Temporal.ZonedDateTime.from(rfc9557_)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export async function gap_$(iso8601_, $task) {
|
|
220
|
+
const duration_ = Temporal.Duration.from(iso8601_);
|
|
221
|
+
return ff_core_Date.DateGap(duration_.years, duration_.months, duration_.weeks, duration_.days, duration_.hours, duration_.minutes, duration_.seconds, duration_.milliseconds, duration_.microseconds, duration_.nanoseconds)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export async function internalDisambiguation_$(earlier_, later_, $task) {
|
|
225
|
+
return {disambiguation: ((earlier_ && later_)
|
|
226
|
+
? "compatible"
|
|
227
|
+
: earlier_
|
|
228
|
+
? "earlier"
|
|
229
|
+
: later_
|
|
230
|
+
? "later"
|
|
231
|
+
: "reject")}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function Date_timeZoneId(self_) {
|
|
235
|
+
return self_.timeZoneId
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function Date_calendarId(self_) {
|
|
239
|
+
return self_.calendarId
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export function Date_day(self_) {
|
|
243
|
+
return self_.day
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function Date_dayOfWeek(self_) {
|
|
247
|
+
return self_.dayOfWeek
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export function Date_dayOfYear(self_) {
|
|
251
|
+
return self_.dayOfYear
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function Date_daysInWeek(self_) {
|
|
255
|
+
return self_.daysInWeek
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function Date_daysInMonth(self_) {
|
|
259
|
+
return self_.daysInMonth
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function Date_daysInYear(self_) {
|
|
263
|
+
return self_.daysInYear
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function Date_epochMilliseconds(self_) {
|
|
267
|
+
return self_.epochMilliseconds
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export function Date_era(self_) {
|
|
271
|
+
const era_ = self_.era;
|
|
272
|
+
if((!ff_core_JsValue.JsValue_isNullOrUndefined(era_))) {
|
|
273
|
+
return ff_core_Option.Some(era_)
|
|
274
|
+
} else return ff_core_Option.None()
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function Date_eraYear(self_) {
|
|
278
|
+
const eraYear_ = self_.eraYear;
|
|
279
|
+
if((!ff_core_JsValue.JsValue_isNullOrUndefined(eraYear_))) {
|
|
280
|
+
return ff_core_Option.Some(eraYear_)
|
|
281
|
+
} else return ff_core_Option.None()
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export function Date_hour(self_) {
|
|
285
|
+
return self_.hour
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function Date_hoursInDay(self_) {
|
|
289
|
+
return self_.hoursInDay
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function Date_inLeapYear(self_) {
|
|
293
|
+
return self_.inLeapYear
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export function Date_microsecond(self_) {
|
|
297
|
+
return self_.microsecond
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export function Date_millisecond(self_) {
|
|
301
|
+
return self_.millisecond
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function Date_minute(self_) {
|
|
305
|
+
return self_.minute
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function Date_month(self_) {
|
|
309
|
+
return self_.month
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function Date_monthCode(self_) {
|
|
313
|
+
return self_.monthCode
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export function Date_monthsInYear(self_) {
|
|
317
|
+
return self_.monthsInYear
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function Date_nanosecond(self_) {
|
|
321
|
+
return self_.nanosecond
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function Date_offset(self_) {
|
|
325
|
+
return self_.offset
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function Date_offsetNanoseconds(self_) {
|
|
329
|
+
return self_.offsetNanoseconds
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export function Date_second(self_) {
|
|
333
|
+
return self_.second
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export function Date_weekOfYear(self_) {
|
|
337
|
+
return self_.weekOfYear
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export function Date_year(self_) {
|
|
341
|
+
return self_.year
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export function Date_yearOfWeek(self_) {
|
|
345
|
+
return self_.yearOfWeek
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function Date_nextTimeZoneTransition(self_) {
|
|
349
|
+
return self_.getTimeZoneTransition("next")
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function Date_previousTimeZoneTransition(self_) {
|
|
353
|
+
return self_.getTimeZoneTransition("previous")
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export function Date_startOfYear(self_) {
|
|
357
|
+
return self_.with({year: ff_core_Date.Date_year(self_), month: 1, day: 1}).startOfDay()
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export function Date_startOfMonth(self_) {
|
|
361
|
+
return self_.with({year: ff_core_Date.Date_year(self_), month: ff_core_Date.Date_month(self_), day: 1}).startOfDay()
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export function Date_startOfWeek(self_, firstDayOfWeek_ = 1) {
|
|
365
|
+
const offset_ = (((ff_core_Date.Date_dayOfWeek(self_) - firstDayOfWeek_) + ff_core_Date.Date_daysInWeek(self_)) % ff_core_Date.Date_daysInWeek(self_));
|
|
366
|
+
return self_.subtract({day: offset_}).startOfDay()
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function Date_startOfDay(self_) {
|
|
370
|
+
return self_.startOfDay()
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export function Date_startOfHour(self_) {
|
|
374
|
+
return self_.round({smallestUnit: "hour", roundingMode: "floor"})
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export function Date_startOfMinute(self_) {
|
|
378
|
+
return self_.round({smallestUnit: "minute", roundingMode: "floor"})
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export function Date_startOfSecond(self_) {
|
|
382
|
+
return self_.round({smallestUnit: "second", roundingMode: "floor"})
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export function Date_startOfMillisecond(self_) {
|
|
386
|
+
return self_.round({smallestUnit: "millisecond", roundingMode: "floor"})
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export function Date_startOfMicrosecond(self_) {
|
|
390
|
+
return self_.round({smallestUnit: "microsecond", roundingMode: "floor"})
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export function Date_toRfc9557(self_, smallestUnit_ = ff_core_Option.None(), fractionalSecondDigits_ = ff_core_Option.None(), timeZone_ = true, offset_ = true, calendar_ = true) {
|
|
394
|
+
return self_.toString({calendarName: (calendar_
|
|
395
|
+
? "auto"
|
|
396
|
+
: "never"), fractionalSecondDigits: ff_core_Option.Option_else(ff_core_Option.Option_map(fractionalSecondDigits_, ((_w1) => {
|
|
397
|
+
return _w1
|
|
398
|
+
})), (() => {
|
|
399
|
+
return "auto"
|
|
400
|
+
})), smallestUnit: ff_core_Option.Option_else(ff_core_Option.Option_map(smallestUnit_, ((_w1) => {
|
|
401
|
+
return _w1
|
|
402
|
+
})), (() => {
|
|
403
|
+
return (void 0)
|
|
404
|
+
})), timeZoneName: (timeZone_
|
|
405
|
+
? "auto"
|
|
406
|
+
: "never"), offset: (offset_
|
|
407
|
+
? "auto"
|
|
408
|
+
: "never")})
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export function Date_withCalendar(self_, calendarId_) {
|
|
412
|
+
return self_.withCalendar(calendarId_)
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export function Date_withTimeZone(self_, timeZoneId_) {
|
|
416
|
+
return self_.withTimeZone(timeZoneId_)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export function Date_withEra(self_, era_, eraYear_, monthCode_ = ff_core_Option.None(), day_ = ff_core_Option.None(), earlier_ = true, later_ = true) {
|
|
420
|
+
return self_.with({era: era_, eraYear: eraYear_, monthCode: ff_core_Option.Option_else(ff_core_Option.Option_map(monthCode_, ((_w1) => {
|
|
421
|
+
return _w1
|
|
422
|
+
})), (() => {
|
|
423
|
+
return (void 0)
|
|
424
|
+
})), day: ff_core_Option.Option_else(ff_core_Option.Option_map(day_, ((_w1) => {
|
|
425
|
+
return _w1
|
|
426
|
+
})), (() => {
|
|
427
|
+
return (void 0)
|
|
428
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export function Date_withMonthCode(self_, monthCode_, day_ = ff_core_Option.None(), earlier_ = true, later_ = true) {
|
|
432
|
+
return self_.with({monthCode: monthCode_, day: ff_core_Option.Option_else(ff_core_Option.Option_map(day_, ((_w1) => {
|
|
433
|
+
return _w1
|
|
434
|
+
})), (() => {
|
|
435
|
+
return (void 0)
|
|
436
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export function Date_with(self_, year_ = ff_core_Option.None(), month_ = ff_core_Option.None(), week_ = ff_core_Option.None(), day_ = ff_core_Option.None(), hour_ = ff_core_Option.None(), minute_ = ff_core_Option.None(), second_ = ff_core_Option.None(), millisecond_ = ff_core_Option.None(), microsecond_ = ff_core_Option.None(), nanosecond_ = ff_core_Option.None(), offset_ = ff_core_Option.None(), earlier_ = true, later_ = true) {
|
|
440
|
+
return self_.with({year: ff_core_Option.Option_else(ff_core_Option.Option_map(year_, ((_w1) => {
|
|
441
|
+
return _w1
|
|
442
|
+
})), (() => {
|
|
443
|
+
return (void 0)
|
|
444
|
+
})), month: ff_core_Option.Option_else(ff_core_Option.Option_map(month_, ((_w1) => {
|
|
445
|
+
return _w1
|
|
446
|
+
})), (() => {
|
|
447
|
+
return (void 0)
|
|
448
|
+
})), week: ff_core_Option.Option_else(ff_core_Option.Option_map(week_, ((_w1) => {
|
|
449
|
+
return _w1
|
|
450
|
+
})), (() => {
|
|
451
|
+
return (void 0)
|
|
452
|
+
})), day: ff_core_Option.Option_else(ff_core_Option.Option_map(day_, ((_w1) => {
|
|
453
|
+
return _w1
|
|
454
|
+
})), (() => {
|
|
455
|
+
return (void 0)
|
|
456
|
+
})), hour: ff_core_Option.Option_else(ff_core_Option.Option_map(hour_, ((_w1) => {
|
|
457
|
+
return _w1
|
|
458
|
+
})), (() => {
|
|
459
|
+
return (void 0)
|
|
460
|
+
})), minute: ff_core_Option.Option_else(ff_core_Option.Option_map(minute_, ((_w1) => {
|
|
461
|
+
return _w1
|
|
462
|
+
})), (() => {
|
|
463
|
+
return (void 0)
|
|
464
|
+
})), second: ff_core_Option.Option_else(ff_core_Option.Option_map(second_, ((_w1) => {
|
|
465
|
+
return _w1
|
|
466
|
+
})), (() => {
|
|
467
|
+
return (void 0)
|
|
468
|
+
})), millisecond: ff_core_Option.Option_else(ff_core_Option.Option_map(millisecond_, ((_w1) => {
|
|
469
|
+
return _w1
|
|
470
|
+
})), (() => {
|
|
471
|
+
return (void 0)
|
|
472
|
+
})), microsecond: ff_core_Option.Option_else(ff_core_Option.Option_map(microsecond_, ((_w1) => {
|
|
473
|
+
return _w1
|
|
474
|
+
})), (() => {
|
|
475
|
+
return (void 0)
|
|
476
|
+
})), nanosecond: ff_core_Option.Option_else(ff_core_Option.Option_map(nanosecond_, ((_w1) => {
|
|
477
|
+
return _w1
|
|
478
|
+
})), (() => {
|
|
479
|
+
return (void 0)
|
|
480
|
+
})), offset: ff_core_Option.Option_else(ff_core_Option.Option_map(offset_, ((_w1) => {
|
|
481
|
+
return _w1
|
|
482
|
+
})), (() => {
|
|
483
|
+
return (void 0)
|
|
484
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export function Date_add(self_, years_ = 0, months_ = 0, weeks_ = 0, days_ = 0, hours_ = 0, minutes_ = 0, seconds_ = 0, milliseconds_ = 0, microseconds_ = 0, nanoseconds_ = 0) {
|
|
488
|
+
return self_.add({years: years_, months: months_, weeks: weeks_, days: days_, hours: hours_, minutes: minutes_, seconds: seconds_, milliseconds: milliseconds_, microseconds: microseconds_, nanoseconds: nanoseconds_})
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export function Date_subtract(self_, years_ = 0, months_ = 0, weeks_ = 0, days_ = 0, hours_ = 0, minutes_ = 0, seconds_ = 0, milliseconds_ = 0, microseconds_ = 0, nanoseconds_ = 0) {
|
|
492
|
+
return self_.subtract({years: years_, months: months_, weeks: weeks_, days: days_, hours: hours_, minutes: minutes_, seconds: seconds_, milliseconds: milliseconds_, microseconds: microseconds_, nanoseconds: nanoseconds_})
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export function Date_addGap(self_, gap_) {
|
|
496
|
+
return self_.add({years: gap_.years_, months: gap_.months_, weeks: gap_.weeks_, days: gap_.days_, hours: gap_.hours_, minutes: gap_.minutes_, seconds: gap_.seconds_, milliseconds: gap_.milliseconds_, microseconds: gap_.microseconds_, nanoseconds: gap_.nanoseconds_})
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export function Date_subtractGap(self_, gap_) {
|
|
500
|
+
return self_.add({years: gap_.years_, months: gap_.months_, weeks: gap_.weeks_, days: gap_.days_, hours: gap_.hours_, minutes: gap_.minutes_, seconds: gap_.seconds_, milliseconds: gap_.milliseconds_, microseconds: gap_.microseconds_, nanoseconds: gap_.nanoseconds_})
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export function Date_since(self_, that_) {
|
|
504
|
+
const duration_ = self_.since(that_);
|
|
505
|
+
return ff_core_Date.DateGap(duration_.years, duration_.months, duration_.weeks, duration_.days, duration_.hours, duration_.minutes, duration_.seconds, duration_.milliseconds, duration_.microseconds, duration_.nanoseconds)
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export function Date_until(self_, that_) {
|
|
509
|
+
const duration_ = self_.until(that_);
|
|
510
|
+
return ff_core_Date.DateGap(duration_.years, duration_.months, duration_.weeks, duration_.days, duration_.hours, duration_.minutes, duration_.seconds, duration_.milliseconds, duration_.microseconds, duration_.nanoseconds)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export function Date_yearsSince(self_, that_) {
|
|
514
|
+
const duration_ = self_.since(that_);
|
|
515
|
+
return duration_.total({unit: "years", relativeTo: that_})
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export function Date_monthsSince(self_, that_) {
|
|
519
|
+
const duration_ = self_.since(that_);
|
|
520
|
+
return duration_.total({unit: "months", relativeTo: that_})
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export function Date_weeksSince(self_, that_) {
|
|
524
|
+
const duration_ = self_.since(that_);
|
|
525
|
+
return duration_.total({unit: "weeks", relativeTo: that_})
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
export function Date_daysSince(self_, that_) {
|
|
529
|
+
const duration_ = self_.since(that_);
|
|
530
|
+
return duration_.total({unit: "days", relativeTo: that_})
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export function Date_hoursSince(self_, that_) {
|
|
534
|
+
const duration_ = self_.since(that_);
|
|
535
|
+
return duration_.total({unit: "hours", relativeTo: that_})
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export function Date_minutesSince(self_, that_) {
|
|
539
|
+
const duration_ = self_.since(that_);
|
|
540
|
+
return duration_.total({unit: "minutes", relativeTo: that_})
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export function Date_secondsSince(self_, that_) {
|
|
544
|
+
const duration_ = self_.since(that_);
|
|
545
|
+
return duration_.total({unit: "seconds", relativeTo: that_})
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export function Date_millisecondsSince(self_, that_) {
|
|
549
|
+
const duration_ = self_.since(that_);
|
|
550
|
+
return duration_.total({unit: "milliseconds", relativeTo: that_})
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export function Date_microsecondsSince(self_, that_) {
|
|
554
|
+
const duration_ = self_.since(that_);
|
|
555
|
+
return duration_.total({unit: "microseconds", relativeTo: that_})
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export function Date_nanosecondsSince(self_, that_) {
|
|
559
|
+
const duration_ = self_.since(that_);
|
|
560
|
+
return duration_.total({unit: "nanoseconds", relativeTo: that_})
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export function Date_schedule(self_, nextDate_) {
|
|
564
|
+
let current_ = self_;
|
|
565
|
+
return ff_core_Stream.Stream_addAll(ff_core_List.List_toStream([self_], false), ff_core_Stream.new_((() => {
|
|
566
|
+
current_ = nextDate_(current_);
|
|
567
|
+
return ff_core_Option.Some(current_)
|
|
568
|
+
}), (() => {
|
|
569
|
+
|
|
570
|
+
})))
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export async function Date_timeZoneId$(self_, $task) {
|
|
574
|
+
return self_.timeZoneId
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export async function Date_calendarId$(self_, $task) {
|
|
578
|
+
return self_.calendarId
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export async function Date_day$(self_, $task) {
|
|
582
|
+
return self_.day
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export async function Date_dayOfWeek$(self_, $task) {
|
|
586
|
+
return self_.dayOfWeek
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export async function Date_dayOfYear$(self_, $task) {
|
|
590
|
+
return self_.dayOfYear
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export async function Date_daysInWeek$(self_, $task) {
|
|
594
|
+
return self_.daysInWeek
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export async function Date_daysInMonth$(self_, $task) {
|
|
598
|
+
return self_.daysInMonth
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export async function Date_daysInYear$(self_, $task) {
|
|
602
|
+
return self_.daysInYear
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export async function Date_epochMilliseconds$(self_, $task) {
|
|
606
|
+
return self_.epochMilliseconds
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export async function Date_era$(self_, $task) {
|
|
610
|
+
const era_ = self_.era;
|
|
611
|
+
if((!ff_core_JsValue.JsValue_isNullOrUndefined(era_))) {
|
|
612
|
+
return ff_core_Option.Some(era_)
|
|
613
|
+
} else return ff_core_Option.None()
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export async function Date_eraYear$(self_, $task) {
|
|
617
|
+
const eraYear_ = self_.eraYear;
|
|
618
|
+
if((!ff_core_JsValue.JsValue_isNullOrUndefined(eraYear_))) {
|
|
619
|
+
return ff_core_Option.Some(eraYear_)
|
|
620
|
+
} else return ff_core_Option.None()
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export async function Date_hour$(self_, $task) {
|
|
624
|
+
return self_.hour
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export async function Date_hoursInDay$(self_, $task) {
|
|
628
|
+
return self_.hoursInDay
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
export async function Date_inLeapYear$(self_, $task) {
|
|
632
|
+
return self_.inLeapYear
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
export async function Date_microsecond$(self_, $task) {
|
|
636
|
+
return self_.microsecond
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export async function Date_millisecond$(self_, $task) {
|
|
640
|
+
return self_.millisecond
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
export async function Date_minute$(self_, $task) {
|
|
644
|
+
return self_.minute
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
export async function Date_month$(self_, $task) {
|
|
648
|
+
return self_.month
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export async function Date_monthCode$(self_, $task) {
|
|
652
|
+
return self_.monthCode
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export async function Date_monthsInYear$(self_, $task) {
|
|
656
|
+
return self_.monthsInYear
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export async function Date_nanosecond$(self_, $task) {
|
|
660
|
+
return self_.nanosecond
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export async function Date_offset$(self_, $task) {
|
|
664
|
+
return self_.offset
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
export async function Date_offsetNanoseconds$(self_, $task) {
|
|
668
|
+
return self_.offsetNanoseconds
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export async function Date_second$(self_, $task) {
|
|
672
|
+
return self_.second
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export async function Date_weekOfYear$(self_, $task) {
|
|
676
|
+
return self_.weekOfYear
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export async function Date_year$(self_, $task) {
|
|
680
|
+
return self_.year
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export async function Date_yearOfWeek$(self_, $task) {
|
|
684
|
+
return self_.yearOfWeek
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export async function Date_nextTimeZoneTransition$(self_, $task) {
|
|
688
|
+
return self_.getTimeZoneTransition("next")
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export async function Date_previousTimeZoneTransition$(self_, $task) {
|
|
692
|
+
return self_.getTimeZoneTransition("previous")
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export async function Date_startOfYear$(self_, $task) {
|
|
696
|
+
return self_.with({year: ff_core_Date.Date_year(self_), month: 1, day: 1}).startOfDay()
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export async function Date_startOfMonth$(self_, $task) {
|
|
700
|
+
return self_.with({year: ff_core_Date.Date_year(self_), month: ff_core_Date.Date_month(self_), day: 1}).startOfDay()
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export async function Date_startOfWeek$(self_, firstDayOfWeek_ = 1, $task) {
|
|
704
|
+
const offset_ = (((ff_core_Date.Date_dayOfWeek(self_) - firstDayOfWeek_) + ff_core_Date.Date_daysInWeek(self_)) % ff_core_Date.Date_daysInWeek(self_));
|
|
705
|
+
return self_.subtract({day: offset_}).startOfDay()
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export async function Date_startOfDay$(self_, $task) {
|
|
709
|
+
return self_.startOfDay()
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export async function Date_startOfHour$(self_, $task) {
|
|
713
|
+
return self_.round({smallestUnit: "hour", roundingMode: "floor"})
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export async function Date_startOfMinute$(self_, $task) {
|
|
717
|
+
return self_.round({smallestUnit: "minute", roundingMode: "floor"})
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export async function Date_startOfSecond$(self_, $task) {
|
|
721
|
+
return self_.round({smallestUnit: "second", roundingMode: "floor"})
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export async function Date_startOfMillisecond$(self_, $task) {
|
|
725
|
+
return self_.round({smallestUnit: "millisecond", roundingMode: "floor"})
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
export async function Date_startOfMicrosecond$(self_, $task) {
|
|
729
|
+
return self_.round({smallestUnit: "microsecond", roundingMode: "floor"})
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export async function Date_toRfc9557$(self_, smallestUnit_ = ff_core_Option.None(), fractionalSecondDigits_ = ff_core_Option.None(), timeZone_ = true, offset_ = true, calendar_ = true, $task) {
|
|
733
|
+
return self_.toString({calendarName: (calendar_
|
|
734
|
+
? "auto"
|
|
735
|
+
: "never"), fractionalSecondDigits: ff_core_Option.Option_else(ff_core_Option.Option_map(fractionalSecondDigits_, ((_w1) => {
|
|
736
|
+
return _w1
|
|
737
|
+
})), (() => {
|
|
738
|
+
return "auto"
|
|
739
|
+
})), smallestUnit: ff_core_Option.Option_else(ff_core_Option.Option_map(smallestUnit_, ((_w1) => {
|
|
740
|
+
return _w1
|
|
741
|
+
})), (() => {
|
|
742
|
+
return (void 0)
|
|
743
|
+
})), timeZoneName: (timeZone_
|
|
744
|
+
? "auto"
|
|
745
|
+
: "never"), offset: (offset_
|
|
746
|
+
? "auto"
|
|
747
|
+
: "never")})
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export async function Date_withCalendar$(self_, calendarId_, $task) {
|
|
751
|
+
return self_.withCalendar(calendarId_)
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export async function Date_withTimeZone$(self_, timeZoneId_, $task) {
|
|
755
|
+
return self_.withTimeZone(timeZoneId_)
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
export async function Date_withEra$(self_, era_, eraYear_, monthCode_ = ff_core_Option.None(), day_ = ff_core_Option.None(), earlier_ = true, later_ = true, $task) {
|
|
759
|
+
return self_.with({era: era_, eraYear: eraYear_, monthCode: ff_core_Option.Option_else(ff_core_Option.Option_map(monthCode_, ((_w1) => {
|
|
760
|
+
return _w1
|
|
761
|
+
})), (() => {
|
|
762
|
+
return (void 0)
|
|
763
|
+
})), day: ff_core_Option.Option_else(ff_core_Option.Option_map(day_, ((_w1) => {
|
|
764
|
+
return _w1
|
|
765
|
+
})), (() => {
|
|
766
|
+
return (void 0)
|
|
767
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
export async function Date_withMonthCode$(self_, monthCode_, day_ = ff_core_Option.None(), earlier_ = true, later_ = true, $task) {
|
|
771
|
+
return self_.with({monthCode: monthCode_, day: ff_core_Option.Option_else(ff_core_Option.Option_map(day_, ((_w1) => {
|
|
772
|
+
return _w1
|
|
773
|
+
})), (() => {
|
|
774
|
+
return (void 0)
|
|
775
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export async function Date_with$(self_, year_ = ff_core_Option.None(), month_ = ff_core_Option.None(), week_ = ff_core_Option.None(), day_ = ff_core_Option.None(), hour_ = ff_core_Option.None(), minute_ = ff_core_Option.None(), second_ = ff_core_Option.None(), millisecond_ = ff_core_Option.None(), microsecond_ = ff_core_Option.None(), nanosecond_ = ff_core_Option.None(), offset_ = ff_core_Option.None(), earlier_ = true, later_ = true, $task) {
|
|
779
|
+
return self_.with({year: ff_core_Option.Option_else(ff_core_Option.Option_map(year_, ((_w1) => {
|
|
780
|
+
return _w1
|
|
781
|
+
})), (() => {
|
|
782
|
+
return (void 0)
|
|
783
|
+
})), month: ff_core_Option.Option_else(ff_core_Option.Option_map(month_, ((_w1) => {
|
|
784
|
+
return _w1
|
|
785
|
+
})), (() => {
|
|
786
|
+
return (void 0)
|
|
787
|
+
})), week: ff_core_Option.Option_else(ff_core_Option.Option_map(week_, ((_w1) => {
|
|
788
|
+
return _w1
|
|
789
|
+
})), (() => {
|
|
790
|
+
return (void 0)
|
|
791
|
+
})), day: ff_core_Option.Option_else(ff_core_Option.Option_map(day_, ((_w1) => {
|
|
792
|
+
return _w1
|
|
793
|
+
})), (() => {
|
|
794
|
+
return (void 0)
|
|
795
|
+
})), hour: ff_core_Option.Option_else(ff_core_Option.Option_map(hour_, ((_w1) => {
|
|
796
|
+
return _w1
|
|
797
|
+
})), (() => {
|
|
798
|
+
return (void 0)
|
|
799
|
+
})), minute: ff_core_Option.Option_else(ff_core_Option.Option_map(minute_, ((_w1) => {
|
|
800
|
+
return _w1
|
|
801
|
+
})), (() => {
|
|
802
|
+
return (void 0)
|
|
803
|
+
})), second: ff_core_Option.Option_else(ff_core_Option.Option_map(second_, ((_w1) => {
|
|
804
|
+
return _w1
|
|
805
|
+
})), (() => {
|
|
806
|
+
return (void 0)
|
|
807
|
+
})), millisecond: ff_core_Option.Option_else(ff_core_Option.Option_map(millisecond_, ((_w1) => {
|
|
808
|
+
return _w1
|
|
809
|
+
})), (() => {
|
|
810
|
+
return (void 0)
|
|
811
|
+
})), microsecond: ff_core_Option.Option_else(ff_core_Option.Option_map(microsecond_, ((_w1) => {
|
|
812
|
+
return _w1
|
|
813
|
+
})), (() => {
|
|
814
|
+
return (void 0)
|
|
815
|
+
})), nanosecond: ff_core_Option.Option_else(ff_core_Option.Option_map(nanosecond_, ((_w1) => {
|
|
816
|
+
return _w1
|
|
817
|
+
})), (() => {
|
|
818
|
+
return (void 0)
|
|
819
|
+
})), offset: ff_core_Option.Option_else(ff_core_Option.Option_map(offset_, ((_w1) => {
|
|
820
|
+
return _w1
|
|
821
|
+
})), (() => {
|
|
822
|
+
return (void 0)
|
|
823
|
+
}))}, ff_core_Date.internalDisambiguation_(earlier_, later_))
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
export async function Date_add$(self_, years_ = 0, months_ = 0, weeks_ = 0, days_ = 0, hours_ = 0, minutes_ = 0, seconds_ = 0, milliseconds_ = 0, microseconds_ = 0, nanoseconds_ = 0, $task) {
|
|
827
|
+
return self_.add({years: years_, months: months_, weeks: weeks_, days: days_, hours: hours_, minutes: minutes_, seconds: seconds_, milliseconds: milliseconds_, microseconds: microseconds_, nanoseconds: nanoseconds_})
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export async function Date_subtract$(self_, years_ = 0, months_ = 0, weeks_ = 0, days_ = 0, hours_ = 0, minutes_ = 0, seconds_ = 0, milliseconds_ = 0, microseconds_ = 0, nanoseconds_ = 0, $task) {
|
|
831
|
+
return self_.subtract({years: years_, months: months_, weeks: weeks_, days: days_, hours: hours_, minutes: minutes_, seconds: seconds_, milliseconds: milliseconds_, microseconds: microseconds_, nanoseconds: nanoseconds_})
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
export async function Date_addGap$(self_, gap_, $task) {
|
|
835
|
+
return self_.add({years: gap_.years_, months: gap_.months_, weeks: gap_.weeks_, days: gap_.days_, hours: gap_.hours_, minutes: gap_.minutes_, seconds: gap_.seconds_, milliseconds: gap_.milliseconds_, microseconds: gap_.microseconds_, nanoseconds: gap_.nanoseconds_})
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export async function Date_subtractGap$(self_, gap_, $task) {
|
|
839
|
+
return self_.add({years: gap_.years_, months: gap_.months_, weeks: gap_.weeks_, days: gap_.days_, hours: gap_.hours_, minutes: gap_.minutes_, seconds: gap_.seconds_, milliseconds: gap_.milliseconds_, microseconds: gap_.microseconds_, nanoseconds: gap_.nanoseconds_})
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export async function Date_since$(self_, that_, $task) {
|
|
843
|
+
const duration_ = self_.since(that_);
|
|
844
|
+
return ff_core_Date.DateGap(duration_.years, duration_.months, duration_.weeks, duration_.days, duration_.hours, duration_.minutes, duration_.seconds, duration_.milliseconds, duration_.microseconds, duration_.nanoseconds)
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
export async function Date_until$(self_, that_, $task) {
|
|
848
|
+
const duration_ = self_.until(that_);
|
|
849
|
+
return ff_core_Date.DateGap(duration_.years, duration_.months, duration_.weeks, duration_.days, duration_.hours, duration_.minutes, duration_.seconds, duration_.milliseconds, duration_.microseconds, duration_.nanoseconds)
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
export async function Date_yearsSince$(self_, that_, $task) {
|
|
853
|
+
const duration_ = self_.since(that_);
|
|
854
|
+
return duration_.total({unit: "years", relativeTo: that_})
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export async function Date_monthsSince$(self_, that_, $task) {
|
|
858
|
+
const duration_ = self_.since(that_);
|
|
859
|
+
return duration_.total({unit: "months", relativeTo: that_})
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
export async function Date_weeksSince$(self_, that_, $task) {
|
|
863
|
+
const duration_ = self_.since(that_);
|
|
864
|
+
return duration_.total({unit: "weeks", relativeTo: that_})
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
export async function Date_daysSince$(self_, that_, $task) {
|
|
868
|
+
const duration_ = self_.since(that_);
|
|
869
|
+
return duration_.total({unit: "days", relativeTo: that_})
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export async function Date_hoursSince$(self_, that_, $task) {
|
|
873
|
+
const duration_ = self_.since(that_);
|
|
874
|
+
return duration_.total({unit: "hours", relativeTo: that_})
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
export async function Date_minutesSince$(self_, that_, $task) {
|
|
878
|
+
const duration_ = self_.since(that_);
|
|
879
|
+
return duration_.total({unit: "minutes", relativeTo: that_})
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export async function Date_secondsSince$(self_, that_, $task) {
|
|
883
|
+
const duration_ = self_.since(that_);
|
|
884
|
+
return duration_.total({unit: "seconds", relativeTo: that_})
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export async function Date_millisecondsSince$(self_, that_, $task) {
|
|
888
|
+
const duration_ = self_.since(that_);
|
|
889
|
+
return duration_.total({unit: "milliseconds", relativeTo: that_})
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
export async function Date_microsecondsSince$(self_, that_, $task) {
|
|
893
|
+
const duration_ = self_.since(that_);
|
|
894
|
+
return duration_.total({unit: "microseconds", relativeTo: that_})
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
export async function Date_nanosecondsSince$(self_, that_, $task) {
|
|
898
|
+
const duration_ = self_.since(that_);
|
|
899
|
+
return duration_.total({unit: "nanoseconds", relativeTo: that_})
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
export async function Date_schedule$(self_, nextDate_, $task) {
|
|
903
|
+
let current_ = self_;
|
|
904
|
+
return (await ff_core_Stream.Stream_addAll$((await ff_core_List.List_toStream$([self_], false, $task)), (await ff_core_Stream.new_$((async ($task) => {
|
|
905
|
+
current_ = (await nextDate_(current_, $task));
|
|
906
|
+
return ff_core_Option.Some(current_)
|
|
907
|
+
}), (async ($task) => {
|
|
908
|
+
|
|
909
|
+
}), $task)), $task))
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export function DateGap_toIso8601(self_, smallestUnit_ = ff_core_Option.None(), fractionalSecondDigits_ = ff_core_Option.None()) {
|
|
913
|
+
const duration_ = Temporal.Duration.from({years: self_.years_, months: self_.months_, weeks: self_.weeks_, days: self_.days_, hours: self_.hours_, minutes: self_.minutes_, seconds: self_.seconds_, milliseconds: self_.milliseconds_, microseconds: self_.microseconds_, nanoseconds: self_.nanoseconds_});
|
|
914
|
+
return duration_.toString({smallestUnit: ff_core_Option.Option_else(ff_core_Option.Option_map(smallestUnit_, ((_w1) => {
|
|
915
|
+
return _w1
|
|
916
|
+
})), (() => {
|
|
917
|
+
return (void 0)
|
|
918
|
+
})), fractionalSecondDigits: ff_core_Option.Option_else(ff_core_Option.Option_map(fractionalSecondDigits_, ((_w1) => {
|
|
919
|
+
return _w1
|
|
920
|
+
})), (() => {
|
|
921
|
+
return "auto"
|
|
922
|
+
}))})
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
export async function DateGap_toIso8601$(self_, smallestUnit_ = ff_core_Option.None(), fractionalSecondDigits_ = ff_core_Option.None(), $task) {
|
|
926
|
+
const duration_ = Temporal.Duration.from({years: self_.years_, months: self_.months_, weeks: self_.weeks_, days: self_.days_, hours: self_.hours_, minutes: self_.minutes_, seconds: self_.seconds_, milliseconds: self_.milliseconds_, microseconds: self_.microseconds_, nanoseconds: self_.nanoseconds_});
|
|
927
|
+
return duration_.toString({smallestUnit: ff_core_Option.Option_else(ff_core_Option.Option_map(smallestUnit_, ((_w1) => {
|
|
928
|
+
return _w1
|
|
929
|
+
})), (() => {
|
|
930
|
+
return (void 0)
|
|
931
|
+
})), fractionalSecondDigits: ff_core_Option.Option_else(ff_core_Option.Option_map(fractionalSecondDigits_, ((_w1) => {
|
|
932
|
+
return _w1
|
|
933
|
+
})), (() => {
|
|
934
|
+
return "auto"
|
|
935
|
+
}))})
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export const ff_core_Equal_Equal$ff_core_Date_Date = {
|
|
939
|
+
equals_(x_, y_) {
|
|
940
|
+
return x_.equals(y_)
|
|
941
|
+
},
|
|
942
|
+
async equals_$(x_, y_, $task) {
|
|
943
|
+
return x_.equals(y_)
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
export const ff_core_Ordering_Order$ff_core_Date_Date = {
|
|
948
|
+
compare_(x_, y_) {
|
|
949
|
+
const instant_ = Temporal.ZonedDateTime.compare(x_, y_);
|
|
950
|
+
if((instant_ !== 0)) {
|
|
951
|
+
return ff_core_Ordering.fromInt_(instant_)
|
|
952
|
+
} else {
|
|
953
|
+
const timeZone_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(ff_core_Date.Date_timeZoneId(x_), ff_core_Date.Date_timeZoneId(y_));
|
|
954
|
+
if((timeZone_ !== ff_core_Ordering.OrderingSame())) {
|
|
955
|
+
return timeZone_
|
|
956
|
+
} else {
|
|
957
|
+
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(ff_core_Date.Date_calendarId(x_), ff_core_Date.Date_calendarId(y_))
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
async compare_$(x_, y_, $task) {
|
|
962
|
+
const instant_ = Temporal.ZonedDateTime.compare(x_, y_);
|
|
963
|
+
if((instant_ !== 0)) {
|
|
964
|
+
return ff_core_Ordering.fromInt_(instant_)
|
|
965
|
+
} else {
|
|
966
|
+
const timeZone_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(ff_core_Date.Date_timeZoneId(x_), ff_core_Date.Date_timeZoneId(y_));
|
|
967
|
+
if((timeZone_ !== ff_core_Ordering.OrderingSame())) {
|
|
968
|
+
return timeZone_
|
|
969
|
+
} else {
|
|
970
|
+
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(ff_core_Date.Date_calendarId(x_), ff_core_Date.Date_calendarId(y_))
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
export const ff_core_Any_HasAnyTag$ff_core_Date_Date = {
|
|
977
|
+
anyTag_() {
|
|
978
|
+
return ff_core_Any.internalAnyTag_("ff:core/Date.Date[]")
|
|
979
|
+
},
|
|
980
|
+
async anyTag_$($task) {
|
|
981
|
+
return ff_core_Any.internalAnyTag_("ff:core/Date.Date[]")
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
export const ff_core_Show_Show$ff_core_Date_Date = {
|
|
986
|
+
show_(value_) {
|
|
987
|
+
return ff_core_Date.Date_toRfc9557(value_, ff_core_Option.None(), ff_core_Option.None(), true, true, true)
|
|
988
|
+
},
|
|
989
|
+
async show_$(value_, $task) {
|
|
990
|
+
return ff_core_Date.Date_toRfc9557(value_, ff_core_Option.None(), ff_core_Option.None(), true, true, true)
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
export const ff_core_Serializable_Serializable$ff_core_Date_Date = {
|
|
995
|
+
serializeUsing_(serialization_, value_) {
|
|
996
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, ff_core_Date.Date_toRfc9557(value_, ff_core_Option.None(), ff_core_Option.None(), true, true, true))
|
|
997
|
+
},
|
|
998
|
+
deserializeUsing_(serialization_) {
|
|
999
|
+
return ff_core_Date.newRfc9557_(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
|
|
1000
|
+
},
|
|
1001
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
1002
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, ff_core_Date.Date_toRfc9557(value_, ff_core_Option.None(), ff_core_Option.None(), true, true, true))
|
|
1003
|
+
},
|
|
1004
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
1005
|
+
return ff_core_Date.newRfc9557_(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
|