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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
// Copyright 2026 Regit.io — Nicolas Koenig
// SPDX-License-Identifier: Apache-2.0
//! Singapore — SGX (Singapore Exchange) trading-calendar snapshot.
//!
//! Singapore's public-holiday schedule reflects the country's plural
//! religious composition: a mixture of fixed Western / civil dates, two
//! Chinese lunar dates (Chinese New Year), one Easter-derived date (Good
//! Friday), one Buddhist lunar date (Vesak Day), two Islamic / Hijri
//! dates (Hari Raya Puasa and Hari Raya Haji), and one Hindu lunar date
//! (Deepavali). None of the religious dates admits a closed-form rule the
//! way Easter does — the Chinese, Buddhist, Islamic, and Hindu calendars
//! depend on astronomical and ecclesiastical determinations that are
//! published year-by-year by the Singapore Ministry of Manpower (MOM) in
//! the Government gazette and mirrored by the Singapore Exchange (SGX) in
//! its annual trading-calendar PDF. This module therefore stores the
//! gazetted dates as a dated snapshot rather than computing them.
//!
//! When a gazetted holiday falls on a Sunday the Singapore Holidays Act
//! 1998 §4 grants the following Monday as a public holiday in lieu (the
//! *observed* day). The table reflects the **observed** SGX trading-
//! closure date — the Sunday rule date itself is not separately listed,
//! because SGX is already closed on Sunday and the gazette directs the
//! market-closure to the in-lieu Monday. Saturday holidays are *not*
//! shifted: §4 names only Sunday as the trigger for an in-lieu Monday,
//! and SGX is already closed on Saturday. Chinese New Year is gazetted as
//! two consecutive days (1st and 2nd of the lunar year); when day 1 lands
//! on a Sunday the in-lieu rule applies to the Sunday and day 2 stays on
//! its Monday, so the two SGX closures become Monday + Tuesday; when day
//! 2 lands on a Sunday only that second day shifts to the following
//! Monday.
//!
//! # Holiday rules
//!
//! ```text
//! New Year's Day 1 January (observed Mon if Sun) fixed
//! Chinese New Year lunar day 1 + day 2 (Mon-in-lieu if needed) lunar
//! Good Friday Easter Sunday − 2 Easter
//! Labour Day 1 May (observed Mon if Sun) fixed
//! Vesak Day full-moon of Vaisakha (Buddhist lunar) lunar
//! Hari Raya Puasa 1 Shawwal (Islamic / Hijri) Islamic
//! National Day 9 August (observed Mon if Sun) fixed
//! Hari Raya Haji 10 Dhu al-Hijjah (Islamic / Hijri) Islamic
//! Deepavali new-moon Hindu calendar (Oct / Nov) Hindu
//! Christmas Day 25 December (observed Mon if Sun) fixed
//! ```
//!
//! # Multi-faith calendar note
//!
//! Singapore's public-holiday list is one of the most religiously diverse
//! of any major financial centre: it ties four religious traditions —
//! Christian (Good Friday, Christmas), Buddhist (Vesak), Islamic (Hari
//! Raya Puasa, Hari Raya Haji), and Hindu (Deepavali) — into the same
//! market-closure schedule, alongside two Chinese lunar dates (Chinese
//! New Year) and the civil quartet of New Year's Day, Labour Day,
//! National Day, and Christmas. There is no algorithmic shortcut for the
//! religious dates; each must be transcribed from MOM's annual
//! Government-gazette notice and cross-checked against SGX's published
//! trading-calendar PDF for the same year.
//!
//! Because the Islamic year is roughly 354 days, Hari Raya Puasa and
//! Hari Raya Haji drift backwards through the Gregorian calendar by
//! about 10–11 days per year. Once every ~33 Gregorian years two
//! instances of the same Islamic festival fall inside one Gregorian
//! year; the table lists both rows when that happens (see 2033 for two
//! Hari Raya Puasa, 2039 for two Hari Raya Haji). The Islamic drift also
//! produces calendar collisions with Chinese New Year roughly once per
//! decade — when 1 Shawwal lands on the same day as a Chinese New Year
//! closure, only one trading-day closure is gazetted; the row carries a
//! `collision` note in its comment (see 2029, 2030, 2031).
//!
//! # Verification
//!
//! - Verification date: 2026-05-23.
//! - Years **2020–2026** are verified against the Singapore Ministry of
//! Manpower gazetted public-holiday notice for the relevant year
//! (`https://www.mom.gov.sg/employment-practices/public-holidays`),
//! cross-checked against the Singapore Exchange annual trading-
//! calendar PDF (`https://www.sgx.com/securities/trading-hours-
//! calendar`).
//! - Years **2027–2040** are past MOM's publication horizon. Their
//! dates are inferred from the deterministic rules and from
//! astronomical / religious-calendar projection tables, namely:
//! * Easter Sunday from the Gregorian computus, then Good Friday =
//! Easter − 2 days;
//! * Chinese New Year days 1 and 2 from the published astronomical
//! lunar new year tables maintained by the Hong Kong Observatory
//! and mirrored on the Wikipedia *Chinese New Year* article;
//! * Vesak Day from the published Theravada full-moon-of-Vesakha
//! tables used by the Buddhist Calendar Council, as mirrored on
//! the Wikipedia *Vesak* article;
//! * Hari Raya Puasa (1 Shawwal) and Hari Raya Haji (10 Dhu al-
//! Hijjah) from the Umm al-Qura Hijri-to-Gregorian conversion
//! tables, adjusted ±1 day where the Singapore Islamic Religious
//! Council (MUIS) historically diverges from the Umm al-Qura
//! announcement by a local-visibility margin;
//! * Deepavali from the Hindu Kartik-Amavasya astronomical tables
//! mirrored on the Wikipedia *Diwali* article.
//!
//! The Holidays Act 1998 §4 Monday-in-lieu rule is then applied to
//! any of the above that lands on a Sunday. Saturday-falling
//! holidays are listed on the Saturday with a "(Sat — not shifted)"
//! note in the row comment, consistent with §4's Sunday-only
//! trigger.
//! - The 2027–2040 rows must be re-verified against the corresponding
//! year's MOM gazette as it is published (typically 1–2 calendar
//! years ahead of the holiday year) before the user relies on a row
//! for a real trade-date computation. The snapshot date in
//! [`SNAPSHOT_DATE`] records when the inference was last refreshed.
//!
//! # Snapshot
//!
//! - Snapshot date: [`SNAPSHOT_DATE`] = `"2026-05-23"`.
//! - Coverage: [`COVERAGE`] = `(2020, 2040)` inclusive.
//! - Out-of-coverage dates return `false` from [`is_holiday`] without
//! panicking — the caller is expected to refresh the snapshot before
//! classifying dates outside the window.
//!
//! # References
//!
//! - Singapore Ministry of Manpower, *Public Holidays in Singapore*
//! (annual Government-gazette notice under the Holidays Act).
//! - Singapore Exchange (SGX), *SGX Securities and Derivatives Trading
//! Calendar* (annual PDF), published at <https://www.sgx.com>.
//! - Holidays Act 1998 (Singapore), §4 — Monday-in-lieu rule for
//! gazetted public holidays falling on a Sunday.
use crateDate;
/// Date of the SGX trading-calendar snapshot embedded in this module,
/// `YYYY-MM-DD`.
pub const SNAPSHOT_DATE: &str = "2026-05-23";
/// Inclusive `(first_year, last_year)` coverage of [`HOLIDAYS`]. Dates
/// outside this window cause [`is_holiday`] to return `false` without
/// consulting the table.
pub const COVERAGE: = ;
/// SGX trading-calendar holidays, sorted ascending by `(year, month,
/// day)`. Each row pairs the observed market-closure date with a comment
/// naming the holiday it implements.
///
/// The list reflects the *observed* closure (i.e. with the Monday-in-lieu
/// rule already applied for Sunday-falling fixed and religious dates);
/// the underlying rule date is named in the row comment when the two
/// differ. Years 2020–2026 are gazetted; years 2027–2040 are projected
/// per the module-level *Verification* note and must be re-verified
/// against the MOM gazette as it is published.
pub const HOLIDAYS: & = &;
/// True if `date` is an SGX-published trading-calendar holiday inside the
/// snapshot's [`COVERAGE`] window.
///
/// The lookup is a binary search over [`HOLIDAYS`], which is sorted
/// ascending by `(year, month, day)`. Dates outside [`COVERAGE`] return
/// `false` without consulting the table — refresh the snapshot before
/// classifying dates past the horizon. Weekends are *not* classified
/// here; SGX is already closed on Saturday and Sunday and that is the
/// caller's business-day predicate to express.
///
/// # Examples
///
/// ```
/// use regit_daycount::Date;
/// use regit_daycount::calendar::singapore;
///
/// // National Day 2024 (Friday) is an SGX holiday.
/// assert!(singapore::is_holiday(Date::ymd(2024, 8, 9).unwrap()));
///
/// // 2024-08-10 is a Saturday — weekends are not classified by
/// // `is_holiday`, only by the caller's business-day predicate.
/// assert!(!singapore::is_holiday(Date::ymd(2024, 8, 10).unwrap()));
/// ```