Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HebrewCalendar.cs
Go to the documentation of this file.
2
3public class HebrewCalendar : Calendar
4{
5 internal sealed class DateBuffer
6 {
7 internal int year;
8
9 internal int month;
10
11 internal int day;
12 }
13
14 public static readonly int HebrewEra = 1;
15
16 private static readonly DateTime s_calendarMinValue = new DateTime(1583, 1, 1);
17
18 private static readonly DateTime s_calendarMaxValue = new DateTime(new DateTime(2239, 9, 29, 23, 59, 59, 999).Ticks + 9999);
19
20 private static ReadOnlySpan<byte> HebrewTable => new byte[1316]
21 {
22 7, 3, 17, 3, 0, 4, 11, 2, 21, 6,
23 1, 3, 13, 2, 25, 4, 5, 3, 16, 2,
24 27, 6, 9, 1, 20, 2, 0, 6, 11, 3,
25 23, 4, 4, 2, 14, 3, 27, 4, 8, 2,
26 18, 3, 28, 6, 11, 1, 22, 5, 2, 3,
27 12, 3, 25, 4, 6, 2, 16, 3, 26, 6,
28 8, 2, 20, 1, 0, 6, 11, 2, 24, 4,
29 4, 3, 15, 2, 25, 6, 8, 1, 19, 2,
30 29, 6, 9, 3, 22, 4, 3, 2, 13, 3,
31 25, 4, 6, 3, 17, 2, 27, 6, 7, 3,
32 19, 2, 31, 4, 11, 3, 23, 4, 5, 2,
33 15, 3, 25, 6, 6, 2, 19, 1, 29, 6,
34 10, 2, 22, 4, 3, 3, 14, 2, 24, 6,
35 6, 1, 17, 3, 28, 5, 8, 3, 20, 1,
36 32, 5, 12, 3, 22, 6, 4, 1, 16, 2,
37 26, 6, 6, 3, 17, 2, 0, 4, 10, 3,
38 22, 4, 3, 2, 14, 3, 24, 6, 5, 2,
39 17, 1, 28, 6, 9, 2, 19, 3, 31, 4,
40 13, 2, 23, 6, 3, 3, 15, 1, 27, 5,
41 7, 3, 17, 3, 29, 4, 11, 2, 21, 6,
42 3, 1, 14, 2, 25, 6, 5, 3, 16, 2,
43 28, 4, 9, 3, 20, 2, 0, 6, 12, 1,
44 23, 6, 4, 2, 14, 3, 26, 4, 8, 2,
45 18, 3, 0, 4, 10, 3, 21, 5, 1, 3,
46 13, 1, 24, 5, 5, 3, 15, 3, 27, 4,
47 8, 2, 19, 3, 29, 6, 10, 2, 22, 4,
48 3, 3, 14, 2, 26, 4, 6, 3, 18, 2,
49 28, 6, 10, 1, 20, 6, 2, 2, 12, 3,
50 24, 4, 5, 2, 16, 3, 28, 4, 8, 3,
51 19, 2, 0, 6, 12, 1, 23, 5, 3, 3,
52 14, 3, 26, 4, 7, 2, 17, 3, 28, 6,
53 9, 2, 21, 4, 1, 3, 13, 2, 25, 4,
54 5, 3, 16, 2, 27, 6, 9, 1, 19, 3,
55 0, 5, 11, 3, 23, 4, 4, 2, 14, 3,
56 25, 6, 7, 1, 18, 2, 28, 6, 9, 3,
57 21, 4, 2, 2, 12, 3, 25, 4, 6, 2,
58 16, 3, 26, 6, 8, 2, 20, 1, 0, 6,
59 11, 2, 22, 6, 4, 1, 15, 2, 25, 6,
60 6, 3, 18, 1, 29, 5, 9, 3, 22, 4,
61 2, 3, 13, 2, 23, 6, 4, 3, 15, 2,
62 27, 4, 7, 3, 19, 2, 31, 4, 11, 3,
63 21, 6, 3, 2, 15, 1, 25, 6, 6, 2,
64 17, 3, 29, 4, 10, 2, 20, 6, 3, 1,
65 13, 3, 24, 5, 4, 3, 16, 1, 27, 5,
66 7, 3, 17, 3, 0, 4, 11, 2, 21, 6,
67 1, 3, 13, 2, 25, 4, 5, 3, 16, 2,
68 29, 4, 9, 3, 19, 6, 30, 2, 13, 1,
69 23, 6, 4, 2, 14, 3, 27, 4, 8, 2,
70 18, 3, 0, 4, 11, 3, 22, 5, 2, 3,
71 14, 1, 26, 5, 6, 3, 16, 3, 28, 4,
72 10, 2, 20, 6, 30, 3, 11, 2, 24, 4,
73 4, 3, 15, 2, 25, 6, 8, 1, 19, 2,
74 29, 6, 9, 3, 22, 4, 3, 2, 13, 3,
75 25, 4, 7, 2, 17, 3, 27, 6, 9, 1,
76 21, 5, 1, 3, 11, 3, 23, 4, 5, 2,
77 15, 3, 25, 6, 6, 2, 19, 1, 29, 6,
78 10, 2, 22, 4, 3, 3, 14, 2, 24, 6,
79 6, 1, 18, 2, 28, 6, 8, 3, 20, 4,
80 2, 2, 12, 3, 24, 4, 4, 3, 16, 2,
81 26, 6, 6, 3, 17, 2, 0, 4, 10, 3,
82 22, 4, 3, 2, 14, 3, 24, 6, 5, 2,
83 17, 1, 28, 6, 9, 2, 21, 4, 1, 3,
84 13, 2, 23, 6, 5, 1, 15, 3, 27, 5,
85 7, 3, 19, 1, 0, 5, 10, 3, 22, 4,
86 2, 3, 13, 2, 24, 6, 4, 3, 15, 2,
87 27, 4, 8, 3, 20, 4, 1, 2, 11, 3,
88 22, 6, 3, 2, 15, 1, 25, 6, 7, 2,
89 17, 3, 29, 4, 10, 2, 21, 6, 1, 3,
90 13, 1, 24, 5, 5, 3, 15, 3, 27, 4,
91 8, 2, 19, 6, 1, 1, 12, 2, 22, 6,
92 3, 3, 14, 2, 26, 4, 6, 3, 18, 2,
93 28, 6, 10, 1, 20, 6, 2, 2, 12, 3,
94 24, 4, 5, 2, 16, 3, 28, 4, 9, 2,
95 19, 6, 30, 3, 12, 1, 23, 5, 3, 3,
96 14, 3, 26, 4, 7, 2, 17, 3, 28, 6,
97 9, 2, 21, 4, 1, 3, 13, 2, 25, 4,
98 5, 3, 16, 2, 27, 6, 9, 1, 19, 6,
99 30, 2, 11, 3, 23, 4, 4, 2, 14, 3,
100 27, 4, 7, 3, 18, 2, 28, 6, 11, 1,
101 22, 5, 2, 3, 12, 3, 25, 4, 6, 2,
102 16, 3, 26, 6, 8, 2, 20, 4, 30, 3,
103 11, 2, 24, 4, 4, 3, 15, 2, 25, 6,
104 8, 1, 18, 3, 29, 5, 9, 3, 22, 4,
105 3, 2, 13, 3, 23, 6, 6, 1, 17, 2,
106 27, 6, 7, 3, 20, 4, 1, 2, 11, 3,
107 23, 4, 5, 2, 15, 3, 25, 6, 6, 2,
108 19, 1, 29, 6, 10, 2, 20, 6, 3, 1,
109 14, 2, 24, 6, 4, 3, 17, 1, 28, 5,
110 8, 3, 20, 4, 1, 3, 12, 2, 22, 6,
111 2, 3, 14, 2, 26, 4, 6, 3, 17, 2,
112 0, 4, 10, 3, 20, 6, 1, 2, 14, 1,
113 24, 6, 5, 2, 15, 3, 28, 4, 9, 2,
114 19, 6, 1, 1, 12, 3, 23, 5, 3, 3,
115 15, 1, 27, 5, 7, 3, 17, 3, 29, 4,
116 11, 2, 21, 6, 1, 3, 12, 2, 25, 4,
117 5, 3, 16, 2, 28, 4, 9, 3, 19, 6,
118 30, 2, 12, 1, 23, 6, 4, 2, 14, 3,
119 26, 4, 8, 2, 18, 3, 0, 4, 10, 3,
120 22, 5, 2, 3, 14, 1, 25, 5, 6, 3,
121 16, 3, 28, 4, 9, 2, 20, 6, 30, 3,
122 11, 2, 23, 4, 4, 3, 15, 2, 27, 4,
123 7, 3, 19, 2, 29, 6, 11, 1, 21, 6,
124 3, 2, 13, 3, 25, 4, 6, 2, 17, 3,
125 27, 6, 9, 1, 20, 5, 30, 3, 10, 3,
126 22, 4, 3, 2, 14, 3, 24, 6, 5, 2,
127 17, 1, 28, 6, 9, 2, 21, 4, 1, 3,
128 13, 2, 23, 6, 5, 1, 16, 2, 27, 6,
129 7, 3, 19, 4, 30, 2, 11, 3, 23, 4,
130 3, 3, 14, 2, 25, 6, 5, 3, 16, 2,
131 28, 4, 9, 3, 21, 4, 2, 2, 12, 3,
132 23, 6, 4, 2, 16, 1, 26, 6, 8, 2,
133 20, 4, 30, 3, 11, 2, 22, 6, 4, 1,
134 14, 3, 25, 5, 6, 3, 18, 1, 29, 5,
135 9, 3, 22, 4, 2, 3, 13, 2, 23, 6,
136 4, 3, 15, 2, 27, 4, 7, 3, 20, 4,
137 1, 2, 11, 3, 21, 6, 3, 2, 15, 1,
138 25, 6, 6, 2, 17, 3, 29, 4, 10, 2,
139 20, 6, 3, 1, 13, 3, 24, 5, 4, 3,
140 17, 1, 28, 5, 8, 3, 18, 6, 1, 1,
141 12, 2, 22, 6, 2, 3, 14, 2, 26, 4,
142 6, 3, 17, 2, 28, 6, 10, 1, 20, 6,
143 1, 2, 12, 3, 24, 4, 5, 2, 15, 3,
144 28, 4, 9, 2, 19, 6, 33, 3, 12, 1,
145 23, 5, 3, 3, 13, 3, 25, 4, 6, 2,
146 16, 3, 26, 6, 8, 2, 20, 4, 30, 3,
147 11, 2, 24, 4, 4, 3, 15, 2, 25, 6,
148 8, 1, 18, 6, 33, 2, 9, 3, 22, 4,
149 3, 2, 13, 3, 25, 4, 6, 3, 17, 2,
150 27, 6, 9, 1, 21, 5, 1, 3, 11, 3,
151 23, 4, 5, 2, 15, 3, 25, 6, 6, 2,
152 19, 4, 33, 3, 10, 2, 22, 4, 3, 3,
153 14, 2, 24, 6, 6, 1
154 };
155
156 private static ReadOnlySpan<byte> LunarMonthLen => new byte[98]
157 {
158 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
159 0, 0, 0, 0, 0, 30, 29, 29, 29, 30,
160 29, 30, 29, 30, 29, 30, 29, 0, 0, 30,
161 29, 30, 29, 30, 29, 30, 29, 30, 29, 30,
162 29, 0, 0, 30, 30, 30, 29, 30, 29, 30,
163 29, 30, 29, 30, 29, 0, 0, 30, 29, 29,
164 29, 30, 30, 29, 30, 29, 30, 29, 30, 29,
165 0, 30, 29, 30, 29, 30, 30, 29, 30, 29,
166 30, 29, 30, 29, 0, 30, 30, 30, 29, 30,
167 30, 29, 30, 29, 30, 29, 30, 29
168 };
169
171
173
174 public override CalendarAlgorithmType AlgorithmType => CalendarAlgorithmType.LunisolarCalendar;
175
176 internal override CalendarId ID => CalendarId.HEBREW;
177
178 public override int[] Eras => new int[1] { HebrewEra };
179
180 public override int TwoDigitYearMax
181 {
182 get
183 {
184 if (_twoDigitYearMax == -1)
185 {
187 }
188 return _twoDigitYearMax;
189 }
190 set
191 {
193 if (value != 99)
194 {
196 }
198 }
199 }
200
201 private static void CheckHebrewYearValue(int y, int era, string varName)
202 {
203 CheckEraRange(era);
204 if (y > 5999 || y < 5343)
205 {
206 throw new ArgumentOutOfRangeException(varName, y, SR.Format(SR.ArgumentOutOfRange_Range, 5343, 5999));
207 }
208 }
209
210 private void CheckHebrewMonthValue(int year, int month, int era)
211 {
212 int monthsInYear = GetMonthsInYear(year, era);
213 if (month < 1 || month > monthsInYear)
214 {
215 throw new ArgumentOutOfRangeException("month", month, SR.Format(SR.ArgumentOutOfRange_Range, 1, monthsInYear));
216 }
217 }
218
219 private void CheckHebrewDayValue(int year, int month, int day, int era)
220 {
221 int daysInMonth = GetDaysInMonth(year, month, era);
222 if (day < 1 || day > daysInMonth)
223 {
224 throw new ArgumentOutOfRangeException("day", day, SR.Format(SR.ArgumentOutOfRange_Range, 1, daysInMonth));
225 }
226 }
227
228 private static void CheckEraRange(int era)
229 {
230 if (era != 0 && era != HebrewEra)
231 {
233 }
234 }
235
236 private static void CheckTicksRange(long ticks)
237 {
238 if (ticks < s_calendarMinValue.Ticks || ticks > s_calendarMaxValue.Ticks)
239 {
241 }
242 }
243
244 private static int GetResult(DateBuffer result, int part)
245 {
246 return part switch
247 {
248 0 => result.year,
249 2 => result.month,
250 3 => result.day,
252 };
253 }
254
255 internal static int GetLunarMonthDay(int gregorianYear, DateBuffer lunarDate)
256 {
257 int num = gregorianYear - 1583;
258 if (num < 0 || num > 656)
259 {
260 throw new ArgumentOutOfRangeException("gregorianYear");
261 }
262 num *= 2;
263 lunarDate.day = HebrewTable[num];
264 int result = HebrewTable[num + 1];
265 switch (lunarDate.day)
266 {
267 case 0:
268 lunarDate.month = 5;
269 lunarDate.day = 1;
270 break;
271 case 30:
272 lunarDate.month = 3;
273 break;
274 case 31:
275 lunarDate.month = 5;
276 lunarDate.day = 2;
277 break;
278 case 32:
279 lunarDate.month = 5;
280 lunarDate.day = 3;
281 break;
282 case 33:
283 lunarDate.month = 3;
284 lunarDate.day = 29;
285 break;
286 default:
287 lunarDate.month = 4;
288 break;
289 }
290 return result;
291 }
292
293 internal virtual int GetDatePart(long ticks, int part)
294 {
295 CheckTicksRange(ticks);
296 new DateTime(ticks).GetDate(out var year, out var month, out var day);
297 DateBuffer dateBuffer = new DateBuffer();
298 dateBuffer.year = year + 3760;
299 int num = GetLunarMonthDay(year, dateBuffer);
300 DateBuffer dateBuffer2 = new DateBuffer();
301 dateBuffer2.year = dateBuffer.year;
302 dateBuffer2.month = dateBuffer.month;
303 dateBuffer2.day = dateBuffer.day;
304 long absoluteDate = GregorianCalendar.GetAbsoluteDate(year, month, day);
305 if (month == 1 && day == 1)
306 {
307 return GetResult(dateBuffer2, part);
308 }
309 long num2 = absoluteDate - GregorianCalendar.GetAbsoluteDate(year, 1, 1);
310 if (num2 + dateBuffer.day <= LunarMonthLen[num * 14 + dateBuffer.month])
311 {
312 dateBuffer2.day += (int)num2;
313 return GetResult(dateBuffer2, part);
314 }
315 dateBuffer2.month++;
316 dateBuffer2.day = 1;
317 num2 -= LunarMonthLen[num * 14 + dateBuffer.month] - dateBuffer.day;
318 if (num2 > 1)
319 {
320 while (num2 > LunarMonthLen[num * 14 + dateBuffer2.month])
321 {
322 num2 -= LunarMonthLen[num * 14 + dateBuffer2.month++];
323 if (dateBuffer2.month > 13 || LunarMonthLen[num * 14 + dateBuffer2.month] == 0)
324 {
325 dateBuffer2.year++;
326 num = HebrewTable[(year + 1 - 1583) * 2 + 1];
327 dateBuffer2.month = 1;
328 }
329 }
330 dateBuffer2.day += (int)(num2 - 1);
331 }
332 return GetResult(dateBuffer2, part);
333 }
334
335 public override DateTime AddMonths(DateTime time, int months)
336 {
337 try
338 {
339 int num = GetDatePart(time.Ticks, 0);
340 int datePart = GetDatePart(time.Ticks, 2);
341 int num2 = GetDatePart(time.Ticks, 3);
342 int num3;
343 if (months >= 0)
344 {
345 int monthsInYear;
346 for (num3 = datePart + months; num3 > (monthsInYear = GetMonthsInYear(num, 0)); num3 -= monthsInYear)
347 {
348 num++;
349 }
350 }
351 else if ((num3 = datePart + months) <= 0)
352 {
353 months = -months;
354 months -= datePart;
355 num--;
356 int monthsInYear;
357 while (months > (monthsInYear = GetMonthsInYear(num, 0)))
358 {
359 num--;
360 months -= monthsInYear;
361 }
362 monthsInYear = GetMonthsInYear(num, 0);
363 num3 = monthsInYear - months;
364 }
365 int daysInMonth = GetDaysInMonth(num, num3);
366 if (num2 > daysInMonth)
367 {
368 num2 = daysInMonth;
369 }
370 return new DateTime(ToDateTime(num, num3, num2, 0, 0, 0, 0).Ticks + time.Ticks % 864000000000L);
371 }
372 catch (ArgumentException)
373 {
375 }
376 }
377
378 public override DateTime AddYears(DateTime time, int years)
379 {
380 int datePart = GetDatePart(time.Ticks, 0);
381 int num = GetDatePart(time.Ticks, 2);
382 int num2 = GetDatePart(time.Ticks, 3);
383 datePart += years;
384 CheckHebrewYearValue(datePart, 0, "years");
385 int monthsInYear = GetMonthsInYear(datePart, 0);
386 if (num > monthsInYear)
387 {
388 num = monthsInYear;
389 }
390 int daysInMonth = GetDaysInMonth(datePart, num);
391 if (num2 > daysInMonth)
392 {
393 num2 = daysInMonth;
394 }
395 long ticks = ToDateTime(datePart, num, num2, 0, 0, 0, 0).Ticks + time.Ticks % 864000000000L;
397 return new DateTime(ticks);
398 }
399
400 public override int GetDayOfMonth(DateTime time)
401 {
402 return GetDatePart(time.Ticks, 3);
403 }
404
405 public override DayOfWeek GetDayOfWeek(DateTime time)
406 {
407 return (DayOfWeek)((int)(time.Ticks / 864000000000L + 1) % 7);
408 }
409
410 internal static int GetHebrewYearType(int year, int era)
411 {
412 CheckHebrewYearValue(year, era, "year");
413 return HebrewTable[(year - 3760 - 1583) * 2 + 1];
414 }
415
416 public override int GetDayOfYear(DateTime time)
417 {
418 int year = GetYear(time);
419 DateTime dateTime = ((year != 5343) ? ToDateTime(year, 1, 1, 0, 0, 0, 0, 0) : new DateTime(1582, 9, 27));
420 return (int)((time.Ticks - dateTime.Ticks) / 864000000000L) + 1;
421 }
422
423 public override int GetDaysInMonth(int year, int month, int era)
424 {
425 CheckEraRange(era);
426 int hebrewYearType = GetHebrewYearType(year, era);
427 CheckHebrewMonthValue(year, month, era);
428 int num = LunarMonthLen[hebrewYearType * 14 + month];
429 if (num == 0)
430 {
432 }
433 return num;
434 }
435
436 public override int GetDaysInYear(int year, int era)
437 {
438 CheckEraRange(era);
439 int hebrewYearType = GetHebrewYearType(year, era);
440 if (hebrewYearType < 4)
441 {
442 return 352 + hebrewYearType;
443 }
444 return 382 + (hebrewYearType - 3);
445 }
446
447 public override int GetEra(DateTime time)
448 {
449 return HebrewEra;
450 }
451
452 public override int GetMonth(DateTime time)
453 {
454 return GetDatePart(time.Ticks, 2);
455 }
456
457 public override int GetMonthsInYear(int year, int era)
458 {
459 if (!IsLeapYear(year, era))
460 {
461 return 12;
462 }
463 return 13;
464 }
465
466 public override int GetYear(DateTime time)
467 {
468 return GetDatePart(time.Ticks, 0);
469 }
470
471 public override bool IsLeapDay(int year, int month, int day, int era)
472 {
473 if (IsLeapMonth(year, month, era))
474 {
475 CheckHebrewDayValue(year, month, day, era);
476 return true;
477 }
478 if (IsLeapYear(year, 0) && month == 6 && day == 30)
479 {
480 return true;
481 }
482 CheckHebrewDayValue(year, month, day, era);
483 return false;
484 }
485
486 public override int GetLeapMonth(int year, int era)
487 {
488 if (IsLeapYear(year, era))
489 {
490 return 7;
491 }
492 return 0;
493 }
494
495 public override bool IsLeapMonth(int year, int month, int era)
496 {
497 bool flag = IsLeapYear(year, era);
498 CheckHebrewMonthValue(year, month, era);
499 if (flag)
500 {
501 return month == 7;
502 }
503 return false;
504 }
505
506 public override bool IsLeapYear(int year, int era)
507 {
508 CheckHebrewYearValue(year, era, "year");
509 return (7L * (long)year + 1) % 19 < 7;
510 }
511
512 private static int GetDayDifference(int lunarYearType, int month1, int day1, int month2, int day2)
513 {
514 if (month1 == month2)
515 {
516 return day1 - day2;
517 }
518 bool flag = month1 > month2;
519 if (flag)
520 {
521 int num = month1;
522 int num2 = day1;
523 month1 = month2;
524 day1 = day2;
525 month2 = num;
526 day2 = num2;
527 }
528 int num3 = LunarMonthLen[lunarYearType * 14 + month1] - day1;
529 month1++;
530 while (month1 < month2)
531 {
532 num3 += LunarMonthLen[lunarYearType * 14 + month1++];
533 }
534 num3 += day2;
535 if (!flag)
536 {
537 return -num3;
538 }
539 return num3;
540 }
541
542 private static DateTime HebrewToGregorian(int hebrewYear, int hebrewMonth, int hebrewDay, int hour, int minute, int second, int millisecond)
543 {
544 int num = hebrewYear - 3760;
545 DateBuffer dateBuffer = new DateBuffer();
546 int lunarMonthDay = GetLunarMonthDay(num, dateBuffer);
547 if (hebrewMonth == dateBuffer.month && hebrewDay == dateBuffer.day)
548 {
549 return new DateTime(num, 1, 1, hour, minute, second, millisecond);
550 }
551 int dayDifference = GetDayDifference(lunarMonthDay, hebrewMonth, hebrewDay, dateBuffer.month, dateBuffer.day);
552 return new DateTime(new DateTime(num, 1, 1).Ticks + dayDifference * 864000000000L + Calendar.TimeToTicks(hour, minute, second, millisecond));
553 }
554
555 public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
556 {
557 CheckHebrewYearValue(year, era, "year");
558 CheckHebrewMonthValue(year, month, era);
559 CheckHebrewDayValue(year, month, day, era);
560 DateTime result = HebrewToGregorian(year, month, day, hour, minute, second, millisecond);
561 CheckTicksRange(result.Ticks);
562 return result;
563 }
564
565 public override int ToFourDigitYear(int year)
566 {
567 if (year < 0)
568 {
570 }
571 if (year < 100)
572 {
573 return base.ToFourDigitYear(year);
574 }
575 if (year > 5999 || year < 5343)
576 {
577 throw new ArgumentOutOfRangeException("year", year, SR.Format(SR.ArgumentOutOfRange_Range, 5343, 5999));
578 }
579 return year;
580 }
581}
static long TimeToTicks(int hour, int minute, int second, int millisecond)
Definition Calendar.cs:365
static void CheckAddResult(long ticks, DateTime minValue, DateTime maxValue)
Definition Calendar.cs:89
static int GetSystemTwoDigitYearSetting(CalendarId CalID, int defaultYearValue)
Definition Calendar.cs:378
static CultureInfo InvariantCulture
static long GetAbsoluteDate(int year, int month, int day)
static ReadOnlySpan< byte > HebrewTable
override int GetMonth(DateTime time)
override CalendarAlgorithmType AlgorithmType
override int ToFourDigitYear(int year)
static DateTime HebrewToGregorian(int hebrewYear, int hebrewMonth, int hebrewDay, int hour, int minute, int second, int millisecond)
static int GetHebrewYearType(int year, int era)
override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
static void CheckTicksRange(long ticks)
override int GetDayOfYear(DateTime time)
override int GetEra(DateTime time)
override bool IsLeapMonth(int year, int month, int era)
static int GetLunarMonthDay(int gregorianYear, DateBuffer lunarDate)
override DayOfWeek GetDayOfWeek(DateTime time)
override int GetLeapMonth(int year, int era)
override int GetDaysInMonth(int year, int month, int era)
virtual int GetDatePart(long ticks, int part)
override DateTime AddMonths(DateTime time, int months)
override bool IsLeapYear(int year, int era)
override int GetMonthsInYear(int year, int era)
static readonly DateTime s_calendarMaxValue
static ReadOnlySpan< byte > LunarMonthLen
override int GetDayOfMonth(DateTime time)
override DateTime AddYears(DateTime time, int years)
void CheckHebrewDayValue(int year, int month, int day, int era)
static int GetResult(DateBuffer result, int part)
override bool IsLeapDay(int year, int month, int day, int era)
void CheckHebrewMonthValue(int year, int month, int era)
static int GetDayDifference(int lunarYearType, int month1, int day1, int month2, int day2)
override int GetYear(DateTime time)
static void CheckHebrewYearValue(int y, int era, string varName)
override int GetDaysInYear(int year, int era)
static readonly DateTime s_calendarMinValue
static string ArgumentOutOfRange_Range
Definition SR.cs:1096
static string ArgumentOutOfRange_AddValue
Definition SR.cs:968
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string InvalidOperation_DateTimeParsing
Definition SR.cs:1434
static string ArgumentOutOfRange_CalendarRange
Definition SR.cs:982
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
static string ArgumentOutOfRange_InvalidEraValue
Definition SR.cs:1040
Definition SR.cs:7
static void ThrowArgumentOutOfRange_Month(int month)
DayOfWeek
Definition DayOfWeek.cs:4