1 /* 2 * hunt-time: A time library for D programming language. 3 * 4 * Copyright (C) 2015-2018 HuntLabs 5 * 6 * Website: https://www.huntlabs.net/ 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 12 module hunt.time.Init; 13 14 // import hunt.time.chrono.AbstractChronology; 15 // import hunt.time.chrono.ChronoPeriodImpl; 16 // import hunt.time.chrono.IsoChronology; 17 // import hunt.time.Clock; 18 // import hunt.time.DayOfWeek; 19 // import hunt.time.Duration; 20 // import hunt.time.format.DateTimeFormatter; 21 // import hunt.time.format.DateTimeFormatterBuilder; 22 // import hunt.time.format.DateTimeTextProvider; 23 // import hunt.time.format.DecimalStyle; 24 // import hunt.time.Instant; 25 // import hunt.time.LocalDate; 26 // import hunt.time.LocalDateTime; 27 // import hunt.time.LocalTime; 28 // import hunt.time.MonthDay; 29 // import hunt.time.OffsetDateTime; 30 // import hunt.time.OffsetTime; 31 // import hunt.time.Period; 32 // import hunt.time.temporal.IsoFields; 33 // import hunt.time.temporal.TemporalQueries; 34 // import hunt.time.temporal.WeekFields; 35 // import hunt.time.util.Calendar; 36 // // import hunt.time.util.Locale; 37 // import hunt.time.Year; 38 // import hunt.time.YearMonth; 39 // import hunt.time.zone.ZoneRules; 40 // import hunt.time.zone.ZoneRulesProvider; 41 // import hunt.time.ZoneId; 42 // import hunt.time.ZoneOffset; 43 // import hunt.time.chrono.Chronology; 44 // import hunt.time.temporal.TemporalUnit; 45 // import hunt.time.temporal.ChronoUnit; 46 // import hunt.time.temporal.ChronoField; 47 // import hunt.time.util.Common; 48 // import hunt.time.temporal.TemporalAccessor; 49 // import hunt.time.temporal.TemporalField; 50 // import hunt.time.temporal.TemporalQuery; 51 // import hunt.time.temporal.ValueRange; 52 // import hunt.time.temporal.Temporal; 53 // import hunt.time.format.ResolverStyle; 54 // import hunt.time.chrono.ChronoLocalDate; 55 // import hunt.time.format.SignStyle; 56 // import hunt.time.format.Parsed; 57 // import hunt.math.BigInteger; 58 // import hunt.collection; 59 // // import hunt.lang; 60 // import hunt.time.util.QueryHelper; 61 // import hunt.util.Comparator; 62 // import hunt.Exceptions; 63 // import hunt.time.zone.ZoneOffsetTransitionRule; 64 // import hunt.time.chrono.IsoEra; 65 // import hunt.time.format.FormatStyle; 66 // import hunt.time.format.TextStyle; 67 // import hunt.time.Month; 68 // import hunt.time.util.ServiceLoader; 69 // import hunt.time.zone.TzdbZoneRulesProvider; 70 71 // shared static this() 72 // { 73 // import hunt.logging; 74 // /* version(HUNT_DEBUG) */ trace("Init shared static this start"); 75 // { 76 // Locale.ENGLISH = Locale.createConstant("en", ""); 77 78 // /** Useful constant for language. 79 // */ 80 // Locale.FRENCH = Locale.createConstant("fr", ""); 81 82 // /** Useful constant for language. 83 // */ 84 // Locale.GERMAN = Locale.createConstant("de", ""); 85 86 // /** Useful constant for language. 87 // */ 88 // Locale.ITALIAN = Locale.createConstant("it", ""); 89 90 // /** Useful constant for language. 91 // */ 92 // Locale.JAPANESE = Locale.createConstant("ja", ""); 93 94 // /** Useful constant for language. 95 // */ 96 // Locale.KOREAN = Locale.createConstant("ko", ""); 97 98 // /** Useful constant for language. 99 // */ 100 // Locale.CHINESE = Locale.createConstant("zh", ""); 101 102 // /** Useful constant for language. 103 // */ 104 // Locale.SIMPLIFIED_CHINESE = Locale.createConstant("zh", "CN"); 105 106 // /** Useful constant for language. 107 // */ 108 // Locale.TRADITIONAL_CHINESE = Locale.createConstant("zh", "TW"); 109 110 // /** Useful constant for country. 111 // */ 112 // Locale.FRANCE = Locale.createConstant("fr", "FR"); 113 114 // /** Useful constant for country. 115 // */ 116 // Locale.GERMANY = Locale.createConstant("de", "DE"); 117 118 // /** Useful constant for country. 119 // */ 120 // Locale.ITALY = Locale.createConstant("it", "IT"); 121 122 // /** Useful constant for country. 123 // */ 124 // Locale.JAPAN = Locale.createConstant("ja", "JP"); 125 126 // /** Useful constant for country. 127 // */ 128 // Locale.KOREA = Locale.createConstant("ko", "KR"); 129 130 // /** Useful constant for country. 131 // */ 132 // Locale.CHINA = Locale.SIMPLIFIED_CHINESE; 133 134 // /** Useful constant for country. 135 // */ 136 // Locale.PRC = Locale.SIMPLIFIED_CHINESE; 137 138 // /** Useful constant for country. 139 // */ 140 // Locale.TAIWAN = Locale.TRADITIONAL_CHINESE; 141 142 // /** Useful constant for country. 143 // */ 144 // Locale.UK = Locale.createConstant("en", "GB"); 145 146 // /** Useful constant for country. 147 // */ 148 // Locale.US = Locale.createConstant("en", "US"); 149 150 // /** Useful constant for country. 151 // */ 152 // Locale.CANADA = Locale.createConstant("en", "CA"); 153 154 // /** Useful constant for country. 155 // */ 156 // Locale.CANADA_FRENCH = Locale.createConstant("fr", "CA"); 157 158 // /** 159 // * Useful constant for the root locale. The root locale is the locale whose 160 // * language, country, and variant are empty ("") strings. This is regarded 161 // * as the base locale of all locales, and is used as the language/country 162 // * neutral locale for the locale sensitive operations. 163 // * 164 // * @since 1.6 165 // */ 166 // Locale.ROOT = Locale.createConstant("", ""); 167 168 // Locale.CHINA = Locale.SIMPLIFIED_CHINESE; 169 // Locale.PRC = Locale.SIMPLIFIED_CHINESE; 170 // Locale.TAIWAN = Locale.TRADITIONAL_CHINESE; 171 // } 172 173 // { 174 // AbstractChronology.CHRONOS_BY_ID = new HashMap!(string, Chronology)(); 175 // AbstractChronology.CHRONOS_BY_TYPE = new HashMap!(string, Chronology)(); 176 // } 177 178 // { 179 // ChronoPeriodImpl.SUPPORTED_UNITS = new ArrayList!TemporalUnit(); 180 // ChronoPeriodImpl.SUPPORTED_UNITS.add(ChronoUnit.YEARS); 181 // ChronoPeriodImpl.SUPPORTED_UNITS.add(ChronoUnit.MONTHS); 182 // ChronoPeriodImpl.SUPPORTED_UNITS.add(ChronoUnit.DAYS); 183 // } 184 185 // { 186 // IsoChronology.INSTANCE = new IsoChronology(); 187 // } 188 189 // { 190 // DecimalStyle.STANDARD = new DecimalStyle('0', '+', '-', '.'); 191 // DecimalStyle.CACHE = new HashMap!(Locale, DecimalStyle)(16, 0.75f /* , 2 */ ); 192 // } 193 194 // { 195 // Clock.SystemClock.OFFSET_SEED = System.currentTimeMillis() / 1000 /* - 1024 */; // initial offest 196 // Clock.SystemClock.UTC = new Clock.SystemClock(ZoneOffset.UTC); 197 // } 198 199 // { 200 // DayOfWeek.MONDAY = new DayOfWeek(0, "MONDAY"); 201 // /** 202 // * The singleton instance for the day-of-week of Tuesday. 203 // * This has the numeric value of {@code 2}. 204 // */ 205 // DayOfWeek.TUESDAY = new DayOfWeek(1, "TUESDAY"); 206 // /** 207 // * The singleton instance for the day-of-week of Wednesday. 208 // * This has the numeric value of {@code 3}. 209 // */ 210 // DayOfWeek.WEDNESDAY = new DayOfWeek(2, "WEDNESDAY"); 211 // /** 212 // * The singleton instance for the day-of-week of Thursday. 213 // * This has the numeric value of {@code 4}. 214 // */ 215 // DayOfWeek.THURSDAY = new DayOfWeek(3, "THURSDAY"); 216 // /** 217 // * The singleton instance for the day-of-week of Friday. 218 // * This has the numeric value of {@code 5}. 219 // */ 220 // DayOfWeek.FRIDAY = new DayOfWeek(4, "FRIDAY"); 221 // /** 222 // * The singleton instance for the day-of-week of Saturday. 223 // * This has the numeric value of {@code 6}. 224 // */ 225 // DayOfWeek.SATURDAY = new DayOfWeek(5, "SATURDAY"); 226 // /** 227 // * The singleton instance for the day-of-week of Sunday. 228 // * This has the numeric value of {@code 7}. 229 // */ 230 // DayOfWeek.SUNDAY = new DayOfWeek(6, "SUNDAY"); 231 232 // DayOfWeek.ENUMS ~= DayOfWeek.MONDAY; 233 // DayOfWeek.ENUMS ~= DayOfWeek.TUESDAY; 234 235 // DayOfWeek.ENUMS ~= DayOfWeek.WEDNESDAY; 236 // DayOfWeek.ENUMS ~= DayOfWeek.THURSDAY; 237 // DayOfWeek.ENUMS ~= DayOfWeek.FRIDAY; 238 // DayOfWeek.ENUMS ~= DayOfWeek.SATURDAY; 239 // DayOfWeek.ENUMS ~= DayOfWeek.SUNDAY; 240 // } 241 242 // { 243 // Duration.ZERO = new Duration(0, 0); 244 // Duration.BI_NANOS_PER_SECOND = BigInteger.valueOf(LocalTime.NANOS_PER_SECOND); 245 246 // { 247 // Duration.DurationUnits.UNITS = new ArrayList!(TemporalUnit)(); 248 249 // Duration.DurationUnits.UNITS.add(ChronoUnit.SECONDS); 250 // Duration.DurationUnits.UNITS.add(ChronoUnit.NANOS); 251 // } 252 // } 253 254 // { 255 // ChronoUnit.NANOS = new ChronoUnit("Nanos", Duration.ofNanos(1)); 256 257 // ChronoUnit.MICROS = new ChronoUnit("Micros", Duration.ofNanos(1000)); 258 259 // ChronoUnit.MILLIS = new ChronoUnit("Millis", Duration.ofNanos(1000_000)); 260 261 // ChronoUnit.SECONDS = new ChronoUnit("Seconds", Duration.ofSeconds(1)); 262 263 // ChronoUnit.MINUTES = new ChronoUnit("Minutes", Duration.ofSeconds(60)); 264 265 // ChronoUnit.HOURS = new ChronoUnit("Hours", Duration.ofSeconds(3600)); 266 267 // ChronoUnit.HALF_DAYS = new ChronoUnit("HalfDays", Duration.ofSeconds(43200)); 268 269 // ChronoUnit.DAYS = new ChronoUnit("Days", Duration.ofSeconds(86400)); 270 271 // ChronoUnit.WEEKS = new ChronoUnit("Weeks", Duration.ofSeconds(7 * 86400L)); 272 273 // ChronoUnit.MONTHS = new ChronoUnit("Months", Duration.ofSeconds(31556952L / 12)); 274 275 // ChronoUnit.YEARS = new ChronoUnit("Years", Duration.ofSeconds(31556952L)); 276 277 // ChronoUnit.DECADES = new ChronoUnit("Decades", Duration.ofSeconds(31556952L * 10L)); 278 279 // ChronoUnit.CENTURIES = new ChronoUnit("Centuries", Duration.ofSeconds(31556952L * 100L)); 280 281 // ChronoUnit.MILLENNIA = new ChronoUnit("Millennia", Duration.ofSeconds(31556952L * 1000L)); 282 283 // ChronoUnit.ERAS = new ChronoUnit("Eras", Duration.ofSeconds(31556952L * 1000_000_000L)); 284 285 // ChronoUnit.FOREVER = new ChronoUnit("Forever", 286 // Duration.ofSeconds(Long.MAX_VALUE, 999_999_999)); 287 // } 288 289 // { 290 291 // ChronoField.NANO_OF_SECOND = new ChronoField(0, "NanoOfSecond", 292 // ChronoUnit.NANOS, ChronoUnit.SECONDS, ValueRange.of(0, 999_999_999)); 293 294 // ChronoField.NANO_OF_DAY = new ChronoField(1, "NanoOfDay", ChronoUnit.NANOS, 295 // ChronoUnit.DAYS, ValueRange.of(0, 86400L * 1000_000_000L - 1)); 296 297 // ChronoField.MICRO_OF_SECOND = new ChronoField(2, "MicroOfSecond", 298 // ChronoUnit.MICROS, ChronoUnit.SECONDS, ValueRange.of(0, 999_999)); 299 300 // ChronoField.MICRO_OF_DAY = new ChronoField(3, "MicroOfDay", ChronoUnit.MICROS, 301 // ChronoUnit.DAYS, ValueRange.of(0, 86400L * 1000_000L - 1)); 302 303 // ChronoField.MILLI_OF_SECOND = new ChronoField(4, "MilliOfSecond", 304 // ChronoUnit.MILLIS, ChronoUnit.SECONDS, ValueRange.of(0, 999)); 305 306 // ChronoField.MILLI_OF_DAY = new ChronoField(5, "MilliOfDay", 307 // ChronoUnit.MILLIS, ChronoUnit.DAYS, ValueRange.of(0, 86400L * 1000L - 1)); 308 309 // ChronoField.SECOND_OF_MINUTE = new ChronoField(6, "SecondOfMinute", 310 // ChronoUnit.SECONDS, ChronoUnit.MINUTES, ValueRange.of(0, 59), "second"); 311 312 // ChronoField.SECOND_OF_DAY = new ChronoField(7, "SecondOfDay", 313 // ChronoUnit.SECONDS, ChronoUnit.DAYS, ValueRange.of(0, 86400L - 1)); 314 315 // ChronoField.MINUTE_OF_HOUR = new ChronoField(8, "MinuteOfHour", 316 // ChronoUnit.MINUTES, ChronoUnit.HOURS, ValueRange.of(0, 59), "minute"); 317 318 // ChronoField.MINUTE_OF_DAY = new ChronoField(9, "MinuteOfDay", 319 // ChronoUnit.MINUTES, ChronoUnit.DAYS, ValueRange.of(0, (24 * 60) - 1)); 320 321 // ChronoField.HOUR_OF_AMPM = new ChronoField(10, "HourOfAmPm", 322 // ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ValueRange.of(0, 11)); 323 324 // ChronoField.CLOCK_HOUR_OF_AMPM = new ChronoField(11, "ClockHourOfAmPm", 325 // ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ValueRange.of(1, 12)); 326 327 // ChronoField.HOUR_OF_DAY = new ChronoField(12, "HourOfDay", 328 // ChronoUnit.HOURS, ChronoUnit.DAYS, ValueRange.of(0, 23), "hour"); 329 330 // ChronoField.CLOCK_HOUR_OF_DAY = new ChronoField(13, "ClockHourOfDay", 331 // ChronoUnit.HOURS, ChronoUnit.DAYS, ValueRange.of(1, 24)); 332 333 // ChronoField.AMPM_OF_DAY = new ChronoField(14, "AmPmOfDay", 334 // ChronoUnit.HALF_DAYS, ChronoUnit.DAYS, ValueRange.of(0, 1), "dayperiod"); 335 336 // ChronoField.DAY_OF_WEEK = new ChronoField(15, "DayOfWeek", 337 // ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7), "weekday"); 338 339 // ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH = new ChronoField(16, 340 // "AlignedDayOfWeekInMonth", ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7)); 341 342 // ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR = new ChronoField(17, 343 // "AlignedDayOfWeekInYear", ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7)); 344 345 // ChronoField.DAY_OF_MONTH = new ChronoField(18, "DayOfMonth", 346 // ChronoUnit.DAYS, ChronoUnit.MONTHS, ValueRange.of(1, 28, 31), "day"); 347 348 // ChronoField.DAY_OF_YEAR = new ChronoField(19, "DayOfYear", 349 // ChronoUnit.DAYS, ChronoUnit.YEARS, ValueRange.of(1, 365, 366)); 350 351 // ChronoField.EPOCH_DAY = new ChronoField(20, "EpochDay", ChronoUnit.DAYS, 352 // ChronoUnit.FOREVER, ValueRange.of(-365243219162L, 365241780471L)); 353 354 // ChronoField.ALIGNED_WEEK_OF_MONTH = new ChronoField(21, "AlignedWeekOfMonth", 355 // ChronoUnit.WEEKS, ChronoUnit.MONTHS, ValueRange.of(1, 4, 5)); 356 357 // ChronoField.ALIGNED_WEEK_OF_YEAR = new ChronoField(22, "AlignedWeekOfYear", 358 // ChronoUnit.WEEKS, ChronoUnit.YEARS, ValueRange.of(1, 53)); 359 360 // ChronoField.MONTH_OF_YEAR = new ChronoField(23, "MonthOfYear", 361 // ChronoUnit.MONTHS, ChronoUnit.YEARS, ValueRange.of(1, 12), "month"); 362 363 // ChronoField.PROLEPTIC_MONTH = new ChronoField(24, "ProlepticMonth", ChronoUnit.MONTHS, 364 // ChronoUnit.FOREVER, ValueRange.of(Year.MIN_VALUE * 12L, Year.MAX_VALUE * 12L + 11)); 365 366 // ChronoField.YEAR_OF_ERA = new ChronoField(25, "YearOfEra", ChronoUnit.YEARS, 367 // ChronoUnit.FOREVER, ValueRange.of(1, Year.MAX_VALUE, Year.MAX_VALUE + 1)); 368 369 // ChronoField.YEAR = new ChronoField(26, "Year", ChronoUnit.YEARS, 370 // ChronoUnit.FOREVER, ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE), "year"); 371 372 // ChronoField.ERA = new ChronoField(27, "Era", ChronoUnit.ERAS, 373 // ChronoUnit.FOREVER, ValueRange.of(0, 1), "era"); 374 375 // ChronoField.INSTANT_SECONDS = new ChronoField(28, "InstantSeconds", ChronoUnit.SECONDS, 376 // ChronoUnit.FOREVER, ValueRange.of(Long.MIN_VALUE, Long.MAX_VALUE)); 377 378 // ChronoField.OFFSET_SECONDS = new ChronoField(29, "OffsetSeconds", 379 // ChronoUnit.SECONDS, ChronoUnit.FOREVER, ValueRange.of(-18 * 3600, 18 * 3600)); 380 // ChronoField._values ~= ChronoField.NANO_OF_SECOND; 381 // ChronoField._values ~= ChronoField.NANO_OF_DAY; 382 // ChronoField._values ~= ChronoField.MICRO_OF_SECOND; 383 // ChronoField._values ~= ChronoField.MICRO_OF_DAY; 384 // ChronoField._values ~= ChronoField.MILLI_OF_SECOND; 385 // ChronoField._values ~= ChronoField.MILLI_OF_DAY; 386 // ChronoField._values ~= ChronoField.SECOND_OF_MINUTE; 387 // ChronoField._values ~= ChronoField.SECOND_OF_DAY; 388 // ChronoField._values ~= ChronoField.MINUTE_OF_HOUR; 389 // ChronoField._values ~= ChronoField.MINUTE_OF_DAY; 390 // ChronoField._values ~= ChronoField.HOUR_OF_AMPM; 391 // ChronoField._values ~= ChronoField.CLOCK_HOUR_OF_AMPM; 392 // ChronoField._values ~= ChronoField.HOUR_OF_DAY; 393 // ChronoField._values ~= ChronoField.CLOCK_HOUR_OF_DAY; 394 // ChronoField._values ~= ChronoField.AMPM_OF_DAY; 395 // ChronoField._values ~= ChronoField.DAY_OF_WEEK; 396 // ChronoField._values ~= ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH; 397 // ChronoField._values ~= ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR; 398 // ChronoField._values ~= ChronoField.DAY_OF_MONTH; 399 // ChronoField._values ~= ChronoField.DAY_OF_YEAR; 400 // ChronoField._values ~= ChronoField.EPOCH_DAY; 401 // ChronoField._values ~= ChronoField.ALIGNED_WEEK_OF_MONTH; 402 // ChronoField._values ~= ChronoField.ALIGNED_WEEK_OF_YEAR; 403 // ChronoField._values ~= ChronoField.MONTH_OF_YEAR; 404 // ChronoField._values ~= ChronoField.PROLEPTIC_MONTH; 405 // ChronoField._values ~= ChronoField.YEAR_OF_ERA; 406 // ChronoField._values ~= ChronoField.YEAR; 407 // ChronoField._values ~= ChronoField.ERA; 408 // ChronoField._values ~= ChronoField.INSTANT_SECONDS; 409 // ChronoField._values ~= ChronoField.OFFSET_SECONDS; 410 // } 411 412 // { 413 // { 414 // IsoFields.Field.DAY_OF_QUARTER = new class IsoFields.Field 415 // { 416 // override public TemporalUnit getBaseUnit() 417 // { 418 // return ChronoUnit.DAYS; 419 // } 420 421 // override public TemporalUnit getRangeUnit() 422 // { 423 // return IsoFields.QUARTER_YEARS; 424 // } 425 426 // override public ValueRange range() 427 // { 428 // return ValueRange.of(1, 90, 92); 429 // } 430 431 // override public bool isSupportedBy(TemporalAccessor temporal) 432 // { 433 // return temporal.isSupported(ChronoField.DAY_OF_YEAR) 434 // && temporal.isSupported(ChronoField.MONTH_OF_YEAR) 435 // && temporal.isSupported(ChronoField.YEAR) && IsoFields.isIso(temporal); 436 // } 437 438 // override public ValueRange rangeRefinedBy(TemporalAccessor temporal) 439 // { 440 // if (isSupportedBy(temporal) == false) 441 // { 442 // throw new Exception("Unsupported field: DayOfQuarter"); 443 // } 444 // long qoy = temporal.getLong(QUARTER_OF_YEAR); 445 // if (qoy == 1) 446 // { 447 // long year = temporal.getLong(ChronoField.YEAR); 448 // return (IsoChronology.INSTANCE.isLeapYear(year) 449 // ? ValueRange.of(1, 91) : ValueRange.of(1, 90)); 450 // } 451 // else if (qoy == 2) 452 // { 453 // return ValueRange.of(1, 91); 454 // } 455 // else if (qoy == 3 || qoy == 4) 456 // { 457 // return ValueRange.of(1, 92); 458 // } // else value not from 1 to 4, so drop through 459 // return range(); 460 // } 461 462 // override public long getFrom(TemporalAccessor temporal) 463 // { 464 // if (isSupportedBy(temporal) == false) 465 // { 466 // throw new Exception("Unsupported field: DayOfQuarter"); 467 // } 468 // int doy = temporal.get(ChronoField.DAY_OF_YEAR); 469 // int moy = temporal.get(ChronoField.MONTH_OF_YEAR); 470 // long year = temporal.getLong(ChronoField.YEAR); 471 // return doy - QUARTER_DAYS[((moy - 1) / 3) + (IsoChronology.INSTANCE.isLeapYear(year) 472 // ? 4 : 0)]; 473 // } 474 // /*@SuppressWarnings("unchecked")*/ 475 // override public Temporal adjustInto(Temporal temporal, long newValue) /* if (is(R : Temporal)) */ 476 // { 477 // // calls getFrom() to check if supported 478 // long curValue = getFrom(temporal); 479 // range().checkValidValue(newValue, this); // leniently check from 1 to 92 TODO: check 480 // return cast(Temporal) temporal._with(ChronoField.DAY_OF_YEAR, 481 // temporal.getLong(ChronoField.DAY_OF_YEAR) + (newValue - curValue)); 482 // } 483 484 // override public ChronoLocalDate resolve(Map!(TemporalField, Long) fieldValues, 485 // TemporalAccessor partialTemporal, ResolverStyle resolverStyle) 486 // { 487 // Long yearLong = fieldValues.get(ChronoField.YEAR); 488 // Long qoyLong = fieldValues.get(QUARTER_OF_YEAR); 489 // if (yearLong is null || qoyLong is null) 490 // { 491 // return null; 492 // } 493 // int y = ChronoField.YEAR.checkValidIntValue(yearLong.longValue()); // always validate 494 // long doq = fieldValues.get(DAY_OF_QUARTER).longValue(); 495 // ensureIso(partialTemporal); 496 // LocalDate date; 497 // if (resolverStyle == ResolverStyle.LENIENT) 498 // { 499 // date = LocalDate.of(y, 1, 1) 500 // .plusMonths(Math.multiplyExact(Math.subtractExact(cast(int)(qoyLong.longValue()), 501 // 1), 3)); 502 // doq = Math.subtractExact(doq, 1); 503 // } 504 // else 505 // { 506 // int qoy = QUARTER_OF_YEAR.range() 507 // .checkValidIntValue(qoyLong.longValue(), QUARTER_OF_YEAR); // validated 508 // date = LocalDate.of(y, ((qoy - 1) * 3) + 1, 1); 509 // if (doq < 1 || doq > 90) 510 // { 511 // if (resolverStyle == ResolverStyle.STRICT) 512 // { 513 // rangeRefinedBy(date).checkValidValue(doq, this); // only allow exact range 514 // } 515 // else 516 // { // SMART 517 // range().checkValidValue(doq, this); // allow 1-92 rolling into next quarter 518 // } 519 // } 520 // doq--; 521 // } 522 // fieldValues.remove(this); 523 // fieldValues.remove(ChronoField.YEAR); 524 // fieldValues.remove(QUARTER_OF_YEAR); 525 // return date.plusDays(doq); 526 // } 527 528 // override string getDisplayName(Locale locale) 529 // { 530 // assert(locale, "locale"); 531 // return toString(); 532 // } 533 534 // override public string toString() 535 // { 536 // return "DayOfQuarter"; 537 // } 538 539 // override int opCmp(TemporalField obj) 540 // { 541 // if (cast(IsoFields.Field)(obj) !is null) 542 // { 543 // IsoFields.Field other = cast(IsoFields.Field) obj; 544 // return compare(toString(), other.toString()); 545 // } 546 // return 0; 547 // } 548 // }; 549 // IsoFields.Field.QUARTER_OF_YEAR = new class IsoFields.Field 550 // { 551 // override public TemporalUnit getBaseUnit() 552 // { 553 // return IsoFields.QUARTER_YEARS; 554 // } 555 556 // override public TemporalUnit getRangeUnit() 557 // { 558 // return ChronoUnit.YEARS; 559 // } 560 561 // override public ValueRange range() 562 // { 563 // return ValueRange.of(1, 4); 564 // } 565 566 // override public bool isSupportedBy(TemporalAccessor temporal) 567 // { 568 // return temporal.isSupported(ChronoField.MONTH_OF_YEAR) 569 // && IsoFields.isIso(temporal); 570 // } 571 572 // override public long getFrom(TemporalAccessor temporal) 573 // { 574 // if (isSupportedBy(temporal) == false) 575 // { 576 // throw new Exception("Unsupported field: QuarterOfYear"); 577 // } 578 // long moy = temporal.getLong(ChronoField.MONTH_OF_YEAR); 579 // return ((moy + 2) / 3); 580 // } 581 582 // override public ValueRange rangeRefinedBy(TemporalAccessor temporal) 583 // { 584 // if (isSupportedBy(temporal) == false) 585 // { 586 // throw new Exception("Unsupported field: QuarterOfYear"); 587 // } 588 // return range() /* super.rangeRefinedBy(temporal) */ ; 589 // } 590 // /*@SuppressWarnings("unchecked")*/ 591 // override public Temporal adjustInto(Temporal temporal, long newValue) /* if (is(R : Temporal)) */ 592 // { 593 // // calls getFrom() to check if supported 594 // long curValue = getFrom(temporal); 595 // range().checkValidValue(newValue, this); // strictly check from 1 to 4 596 // return cast(Temporal) temporal._with(ChronoField.MONTH_OF_YEAR, 597 // temporal.getLong(ChronoField.MONTH_OF_YEAR) + (newValue - curValue) * 3); 598 // } 599 600 // override string getDisplayName(Locale locale) 601 // { 602 // assert(locale, "locale"); 603 // return toString(); 604 // } 605 606 // override public string toString() 607 // { 608 // return "QuarterOfYear"; 609 // } 610 611 // override TemporalAccessor resolve(Map!(TemporalField, Long) fieldValues, 612 // TemporalAccessor partialTemporal, ResolverStyle resolverStyle) 613 // { 614 // return null; 615 // } 616 617 // override int opCmp(TemporalField obj) 618 // { 619 // if (cast(IsoFields.Field)(obj) !is null) 620 // { 621 // IsoFields.Field other = cast(IsoFields.Field) obj; 622 // return compare(toString(), other.toString()); 623 // } 624 // return 0; 625 // } 626 // }; 627 628 // IsoFields.Field.WEEK_OF_WEEK_BASED_YEAR = new class IsoFields.Field 629 // { 630 // override public string getDisplayName(Locale locale) 631 // { 632 // ///@gxc 633 // // assert(locale, "locale"); 634 // // LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() 635 // // .getLocaleResources( 636 // // CalendarDataUtility 637 // // .findRegionOverride(locale)); 638 // // ResourceBundle rb = lr.getJavaTimeFormatData(); 639 // // return rb.containsKey("field.week") ? rb.getString("field.week") : toString(); 640 // implementationMissing(); 641 // return null; 642 // } 643 644 // override public TemporalUnit getBaseUnit() 645 // { 646 // return ChronoUnit.WEEKS; 647 // } 648 649 // override public TemporalUnit getRangeUnit() 650 // { 651 // return IsoFields.WEEK_BASED_YEARS; 652 // } 653 654 // override public ValueRange range() 655 // { 656 // return ValueRange.of(1, 52, 53); 657 // } 658 659 // override public bool isSupportedBy(TemporalAccessor temporal) 660 // { 661 // return temporal.isSupported(ChronoField.EPOCH_DAY) && IsoFields.isIso(temporal); 662 // } 663 664 // override public ValueRange rangeRefinedBy(TemporalAccessor temporal) 665 // { 666 // if (isSupportedBy(temporal) == false) 667 // { 668 // throw new Exception("Unsupported field: WeekOfWeekBasedYear"); 669 // } 670 // return IsoFields.Field.getWeekRange(LocalDate.from(temporal)); 671 // } 672 673 // override public long getFrom(TemporalAccessor temporal) 674 // { 675 // if (isSupportedBy(temporal) == false) 676 // { 677 // throw new Exception("Unsupported field: WeekOfWeekBasedYear"); 678 // } 679 // return IsoFields.Field.getWeek(LocalDate.from(temporal)); 680 // } 681 // /*@SuppressWarnings("unchecked")*/ 682 // override public Temporal adjustInto(Temporal temporal, long newValue) /* if (is(R : Temporal)) */ 683 // { 684 // // calls getFrom() to check if supported 685 // range().checkValidValue(newValue, this); // lenient range 686 // return cast(Temporal) temporal.plus(Math.subtractExact(newValue, 687 // getFrom(temporal)), ChronoUnit.WEEKS); 688 // } 689 690 // override public ChronoLocalDate resolve(Map!(TemporalField, Long) fieldValues, 691 // TemporalAccessor partialTemporal, ResolverStyle resolverStyle) 692 // { 693 // Long wbyLong = fieldValues.get(WEEK_BASED_YEAR); 694 // Long dowLong = fieldValues.get(ChronoField.DAY_OF_WEEK); 695 // if (wbyLong is null || dowLong is null) 696 // { 697 // return null; 698 // } 699 // int wby = WEEK_BASED_YEAR.range() 700 // .checkValidIntValue(wbyLong.longValue(), WEEK_BASED_YEAR); // always validate 701 // long wowby = fieldValues.get(WEEK_OF_WEEK_BASED_YEAR).longValue(); 702 // ensureIso(partialTemporal); 703 // LocalDate date = LocalDate.of(wby, 1, 4); 704 // if (resolverStyle == ResolverStyle.LENIENT) 705 // { 706 // long dow = dowLong.longValue(); // unvalidated 707 // if (dow > 7) 708 // { 709 // date = date.plusWeeks((dow - 1) / 7); 710 // dow = ((dow - 1) % 7) + 1; 711 // } 712 // else if (dow < 1) 713 // { 714 // date = date.plusWeeks(Math.subtractExact(dow, 7) / 7); 715 // dow = ((dow + 6) % 7) + 1; 716 // } 717 // date = date.plusWeeks(Math.subtractExact(wowby, 1)) 718 // ._with(ChronoField.DAY_OF_WEEK, dow); 719 // } 720 // else 721 // { 722 // int dow = ChronoField.DAY_OF_WEEK.checkValidIntValue(dowLong.longValue()); // validated 723 // if (wowby < 1 || wowby > 52) 724 // { 725 // if (resolverStyle == ResolverStyle.STRICT) 726 // { 727 // getWeekRange(date).checkValidValue(wowby, this); // only allow exact range 728 // } 729 // else 730 // { // SMART 731 // range().checkValidValue(wowby, this); // allow 1-53 rolling into next year 732 // } 733 // } 734 // date = date.plusWeeks(wowby - 1)._with(ChronoField.DAY_OF_WEEK, dow); 735 // } 736 // fieldValues.remove(this); 737 // fieldValues.remove(WEEK_BASED_YEAR); 738 // fieldValues.remove(ChronoField.DAY_OF_WEEK); 739 // return date; 740 // } 741 742 // /* override */ 743 // // string getDisplayName(Locale locale) 744 // // { 745 // // assert(locale, "locale"); 746 // // return toString(); 747 // // } 748 749 // override public string toString() 750 // { 751 // return "WeekOfWeekBasedYear"; 752 // } 753 754 // override int opCmp(TemporalField obj) 755 // { 756 // if (cast(IsoFields.Field)(obj) !is null) 757 // { 758 // IsoFields.Field other = cast(IsoFields.Field) obj; 759 // return compare(toString(), other.toString()); 760 // } 761 // return 0; 762 // } 763 // }; 764 765 // IsoFields.Field.WEEK_BASED_YEAR = new class IsoFields.Field 766 // { 767 // override public TemporalUnit getBaseUnit() 768 // { 769 // return IsoFields.WEEK_BASED_YEARS; 770 // } 771 772 // override public TemporalUnit getRangeUnit() 773 // { 774 // return ChronoUnit.FOREVER; 775 // } 776 777 // override public ValueRange range() 778 // { 779 // return ChronoField.YEAR.range(); 780 // } 781 782 // override public bool isSupportedBy(TemporalAccessor temporal) 783 // { 784 // return temporal.isSupported(ChronoField.EPOCH_DAY) && IsoFields.isIso(temporal); 785 // } 786 787 // override public long getFrom(TemporalAccessor temporal) 788 // { 789 // if (isSupportedBy(temporal) == false) 790 // { 791 // throw new Exception("Unsupported field: WeekBasedYear"); 792 // } 793 // return IsoFields.Field.getWeekBasedYear(LocalDate.from(temporal)); 794 // } 795 796 // override public ValueRange rangeRefinedBy(TemporalAccessor temporal) 797 // { 798 // if (isSupportedBy(temporal) == false) 799 // { 800 // throw new Exception("Unsupported field: WeekBasedYear"); 801 // } 802 // return range() /* super.rangeRefinedBy(temporal) */ ; 803 // } 804 // /*@SuppressWarnings("unchecked")*/ 805 // override public Temporal adjustInto(Temporal temporal, long newValue) /* if (is(R : Temporal)) */ 806 // { 807 // if (isSupportedBy(temporal) == false) 808 // { 809 // throw new Exception("Unsupported field: WeekBasedYear"); 810 // } 811 // int newWby = range().checkValidIntValue(newValue, WEEK_BASED_YEAR); // strict check 812 // LocalDate date = LocalDate.from(temporal); 813 // int dow = date.get(ChronoField.DAY_OF_WEEK); 814 // int week = getWeek(date); 815 // if (week == 53 && getWeekRange(newWby) == 52) 816 // { 817 // week = 52; 818 // } 819 // LocalDate resolved = LocalDate.of(newWby, 1, 4); // 4th is guaranteed to be _in week one 820 // int days = (dow - resolved.get(ChronoField.DAY_OF_WEEK)) + ((week - 1) * 7); 821 // resolved = resolved.plusDays(days); 822 // return cast(Temporal) temporal._with(resolved); 823 // } 824 825 // override string getDisplayName(Locale locale) 826 // { 827 // assert(locale, "locale"); 828 // return toString(); 829 // } 830 831 // override public string toString() 832 // { 833 // return "WeekBasedYear"; 834 // } 835 836 // override TemporalAccessor resolve(Map!(TemporalField, Long) fieldValues, 837 // TemporalAccessor partialTemporal, ResolverStyle resolverStyle) 838 // { 839 // return null; 840 // } 841 842 // override int opCmp(TemporalField obj) 843 // { 844 // if (cast(IsoFields.Field)(obj) !is null) 845 // { 846 // IsoFields.Field other = cast(IsoFields.Field) obj; 847 // return compare(toString(), other.toString()); 848 // } 849 // return 0; 850 // } 851 // }; 852 853 // } 854 855 // { 856 // IsoFields.Unit.WEEK_BASED_YEARS = new IsoFields.Unit("WeekBasedYears", 857 // Duration.ofSeconds(31556952L)); 858 // IsoFields.Unit.QUARTER_YEARS = new IsoFields.Unit("QuarterYears", 859 // Duration.ofSeconds(31556952L / 4)); 860 // } 861 862 // IsoFields.DAY_OF_QUARTER = IsoFields.Field.DAY_OF_QUARTER; 863 // IsoFields.QUARTER_OF_YEAR = IsoFields.Field.QUARTER_OF_YEAR; 864 // IsoFields.WEEK_OF_WEEK_BASED_YEAR = IsoFields.Field.WEEK_OF_WEEK_BASED_YEAR; 865 // IsoFields.WEEK_BASED_YEAR = IsoFields.Field.WEEK_BASED_YEAR; 866 // IsoFields.QUARTER_YEARS = IsoFields.Unit.QUARTER_YEARS; 867 // } 868 869 // { 870 // DateTimeFormatterBuilder.QUERY_REGION_ONLY = new class TemporalQuery!(ZoneId) 871 // { 872 // ZoneId queryFrom(TemporalAccessor temporal) 873 // { 874 // ZoneId zone = QueryHelper.query!ZoneId(temporal, TemporalQueries.zoneId()); 875 // return (zone !is null && (cast(ZoneOffset)(zone) !is null) == false ? zone : null); 876 // } 877 // }; 878 879 // DateTimeFormatterBuilder.FIELD_MAP = new HashMap!(char, TemporalField)(); 880 881 // { 882 // DateTimeFormatterBuilder.ReducedPrinterParser.BASE_DATE = LocalDate.of(2000, 1, 1); 883 // } 884 885 // { 886 // DateTimeFormatterBuilder.OffsetIdPrinterParser.INSTANCE_ID_Z 887 // = new DateTimeFormatterBuilder.OffsetIdPrinterParser("+HH:MM:ss", "Z"); 888 // DateTimeFormatterBuilder.OffsetIdPrinterParser.INSTANCE_ID_ZERO 889 // = new DateTimeFormatterBuilder.OffsetIdPrinterParser("+HH:MM:ss", "0"); 890 // } 891 892 // { 893 // DateTimeFormatterBuilder.ZoneTextPrinterParser.cache = new HashMap!(string, 894 // Map!(Locale, string[]))(); 895 // } 896 897 // { 898 // DateTimeFormatterBuilder.LocalizedPrinterParser.FORMATTER_CACHE = new HashMap!(string, 899 // DateTimeFormatter)(16, 0.75f /* , 2 */ ); 900 // } 901 902 // DateTimeFormatterBuilder.LENGTH_SORT = new class Comparator!(string) 903 // { 904 // override public int compare(string str1, string str2) 905 // { 906 // return str1.length == str2.length ? str1.compare(str2) 907 // : cast(int)(str1.length - str2.length); 908 // } 909 // }; 910 // // SDF = SimpleDateFormat 911 // DateTimeFormatterBuilder.FIELD_MAP.put('G', ChronoField.ERA); // SDF, LDML (different to both for 1/2 chars) 912 // DateTimeFormatterBuilder.FIELD_MAP.put('y', ChronoField.YEAR_OF_ERA); // SDF, LDML 913 // DateTimeFormatterBuilder.FIELD_MAP.put('u', ChronoField.YEAR); // LDML (different _in SDF) 914 // DateTimeFormatterBuilder.FIELD_MAP.put('Q', IsoFields.QUARTER_OF_YEAR); // LDML (removed quarter from 310) 915 // DateTimeFormatterBuilder.FIELD_MAP.put('q', IsoFields.QUARTER_OF_YEAR); // LDML (stand-alone) 916 // DateTimeFormatterBuilder.FIELD_MAP.put('M', ChronoField.MONTH_OF_YEAR); // SDF, LDML 917 // DateTimeFormatterBuilder.FIELD_MAP.put('L', ChronoField.MONTH_OF_YEAR); // SDF, LDML (stand-alone) 918 // DateTimeFormatterBuilder.FIELD_MAP.put('D', ChronoField.DAY_OF_YEAR); // SDF, LDML 919 // DateTimeFormatterBuilder.FIELD_MAP.put('d', ChronoField.DAY_OF_MONTH); // SDF, LDML 920 // DateTimeFormatterBuilder.FIELD_MAP.put('F', ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH); // SDF, LDML 921 // DateTimeFormatterBuilder.FIELD_MAP.put('E', ChronoField.DAY_OF_WEEK); // SDF, LDML (different to both for 1/2 chars) 922 // DateTimeFormatterBuilder.FIELD_MAP.put('c', ChronoField.DAY_OF_WEEK); // LDML (stand-alone) 923 // DateTimeFormatterBuilder.FIELD_MAP.put('e', ChronoField.DAY_OF_WEEK); // LDML (needs localized week number) 924 // DateTimeFormatterBuilder.FIELD_MAP.put('a', ChronoField.AMPM_OF_DAY); // SDF, LDML 925 // DateTimeFormatterBuilder.FIELD_MAP.put('H', ChronoField.HOUR_OF_DAY); // SDF, LDML 926 // DateTimeFormatterBuilder.FIELD_MAP.put('k', ChronoField.CLOCK_HOUR_OF_DAY); // SDF, LDML 927 // DateTimeFormatterBuilder.FIELD_MAP.put('K', ChronoField.HOUR_OF_AMPM); // SDF, LDML 928 // DateTimeFormatterBuilder.FIELD_MAP.put('h', ChronoField.CLOCK_HOUR_OF_AMPM); // SDF, LDML 929 // DateTimeFormatterBuilder.FIELD_MAP.put('m', ChronoField.MINUTE_OF_HOUR); // SDF, LDML 930 // DateTimeFormatterBuilder.FIELD_MAP.put('s', ChronoField.SECOND_OF_MINUTE); // SDF, LDML 931 // DateTimeFormatterBuilder.FIELD_MAP.put('S', ChronoField.NANO_OF_SECOND); // LDML (SDF uses milli-of-second number) 932 // DateTimeFormatterBuilder.FIELD_MAP.put('A', ChronoField.MILLI_OF_DAY); // LDML 933 // DateTimeFormatterBuilder.FIELD_MAP.put('n', ChronoField.NANO_OF_SECOND); // 310 (proposed for LDML) 934 // DateTimeFormatterBuilder.FIELD_MAP.put('N', ChronoField.NANO_OF_DAY); // 310 (proposed for LDML) 935 // // FIELD_MAP.put('g', JulianFields.MODIFIED_JULIAN_DAY); 936 937 // { 938 // DateTimeFormatterBuilder.SettingsParser.SENSITIVE = new DateTimeFormatterBuilder.SettingsParser( 939 // 0); 940 // DateTimeFormatterBuilder.SettingsParser.INSENSITIVE = new DateTimeFormatterBuilder.SettingsParser( 941 // 1); 942 // DateTimeFormatterBuilder.SettingsParser.STRICT = new DateTimeFormatterBuilder.SettingsParser( 943 // 2); 944 // DateTimeFormatterBuilder.SettingsParser.LENIENT = new DateTimeFormatterBuilder.SettingsParser( 945 // 3); 946 // } 947 948 // } 949 950 // { 951 // DateTimeFormatter.PARSED_EXCESS_DAYS = new class TemporalQuery!(Period) 952 // { 953 // Period queryFrom(TemporalAccessor t) 954 // { 955 // if (cast(Parsed)(t) !is null) 956 // { 957 // return (cast(Parsed) t).excessDays; 958 // } 959 // else 960 // { 961 // return Period.ZERO; 962 // } 963 // } 964 // }; 965 966 // DateTimeFormatter.PARSED_LEAP_SECOND = new class TemporalQuery!(Boolean) 967 // { 968 // Boolean queryFrom(TemporalAccessor t) 969 // { 970 // if (cast(Parsed)(t) !is null) 971 // { 972 // return new Boolean((cast(Parsed) t).leapSecond); 973 // } 974 // else 975 // { 976 // return Boolean.FALSE; 977 // } 978 // } 979 // }; 980 981 // DateTimeFormatter.BASIC_ISO_DATE = new DateTimeFormatterBuilder().parseCaseInsensitive() 982 // .appendValue(ChronoField.YEAR, 4).appendValue(ChronoField.MONTH_OF_YEAR, 2) 983 // .appendValue(ChronoField.DAY_OF_MONTH, 2).optionalStart().parseLenient().appendOffset("+HHMMss", "Z") 984 // .parseStrict().toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 985 986 // DateTimeFormatter.ISO_INSTANT = new DateTimeFormatterBuilder() 987 // .parseCaseInsensitive().appendInstant().toFormatter(ResolverStyle.STRICT, null); 988 989 // DateTimeFormatter.ISO_WEEK_DATE = new DateTimeFormatterBuilder().parseCaseInsensitive() 990 // .appendValue(IsoFields.WEEK_BASED_YEAR, 4, 10, SignStyle.EXCEEDS_PAD).appendLiteral("-W") 991 // .appendValue(IsoFields.WEEK_OF_WEEK_BASED_YEAR, 992 // 2).appendLiteral('-').appendValue(ChronoField.DAY_OF_WEEK, 1).optionalStart().appendOffsetId() 993 // .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 994 995 // DateTimeFormatter.ISO_ORDINAL_DATE = new DateTimeFormatterBuilder().parseCaseInsensitive() 996 // .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD).appendLiteral('-') 997 // .appendValue(ChronoField.DAY_OF_YEAR, 3) 998 // .optionalStart().appendOffsetId().toFormatter(ResolverStyle.STRICT, 999 // IsoChronology.INSTANCE); 1000 1001 // DateTimeFormatter.ISO_LOCAL_TIME = new DateTimeFormatterBuilder().appendValue(ChronoField.HOUR_OF_DAY, 2) 1002 // .appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).optionalStart() 1003 // .appendLiteral(':').appendValue(ChronoField.SECOND_OF_MINUTE, 2).optionalStart() 1004 // .appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true).toFormatter( 1005 // ResolverStyle.STRICT, null); 1006 1007 // DateTimeFormatter.ISO_LOCAL_DATE = new DateTimeFormatterBuilder().appendValue(ChronoField.YEAR, 4, 1008 // 10, SignStyle.EXCEEDS_PAD).appendLiteral('-') 1009 // .appendValue(ChronoField.MONTH_OF_YEAR, 2).appendLiteral('-') 1010 // .appendValue(ChronoField.DAY_OF_MONTH, 2).toFormatter(ResolverStyle.STRICT, 1011 // IsoChronology.INSTANCE); 1012 1013 // DateTimeFormatter.ISO_LOCAL_DATE_TIME = new DateTimeFormatterBuilder() 1014 // .parseCaseInsensitive().append(DateTimeFormatter.ISO_LOCAL_DATE) 1015 // .appendLiteral('T').append(DateTimeFormatter.ISO_LOCAL_TIME) 1016 // .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1017 1018 // DateTimeFormatter.ISO_OFFSET_DATE_TIME = new DateTimeFormatterBuilder().parseCaseInsensitive() 1019 // .append(DateTimeFormatter.ISO_LOCAL_DATE_TIME).parseLenient().appendOffsetId() 1020 // .parseStrict().toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1021 1022 // DateTimeFormatter.ISO_DATE_TIME = new DateTimeFormatterBuilder().append(DateTimeFormatter.ISO_LOCAL_DATE_TIME) 1023 // .optionalStart().appendOffsetId().optionalStart().appendLiteral('[').parseCaseSensitive() 1024 // .appendZoneRegionId().appendLiteral(']') 1025 // .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1026 1027 // DateTimeFormatter.ISO_ZONED_DATE_TIME = new DateTimeFormatterBuilder() 1028 // .append(DateTimeFormatter.ISO_OFFSET_DATE_TIME) 1029 // .optionalStart().appendLiteral('[').parseCaseSensitive().appendZoneRegionId() 1030 // .appendLiteral(']').toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1031 1032 // DateTimeFormatter.ISO_LOCAL_DATE_TIME = new DateTimeFormatterBuilder() 1033 // .parseCaseInsensitive().append(DateTimeFormatter.ISO_LOCAL_DATE) 1034 // .appendLiteral('T').append(DateTimeFormatter.ISO_LOCAL_TIME) 1035 // .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1036 1037 // DateTimeFormatter.ISO_TIME = new DateTimeFormatterBuilder().parseCaseInsensitive() 1038 // .append(DateTimeFormatter.ISO_LOCAL_TIME).optionalStart() 1039 // .appendOffsetId().toFormatter(ResolverStyle.STRICT, null); 1040 1041 // DateTimeFormatter.ISO_OFFSET_TIME = new DateTimeFormatterBuilder().parseCaseInsensitive() 1042 // .append(DateTimeFormatter.ISO_LOCAL_TIME).appendOffsetId() 1043 // .toFormatter(ResolverStyle.STRICT, null); 1044 1045 // DateTimeFormatter.ISO_DATE = new DateTimeFormatterBuilder().parseCaseInsensitive() 1046 // .append(DateTimeFormatter.ISO_LOCAL_DATE).optionalStart().appendOffsetId() 1047 // .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1048 1049 // DateTimeFormatter.ISO_OFFSET_DATE = new DateTimeFormatterBuilder() 1050 // .parseCaseInsensitive().append(DateTimeFormatter.ISO_LOCAL_DATE) 1051 // .appendOffsetId().toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); 1052 1053 // // manually code maps to ensure correct data always used 1054 // // (locale data can be changed by application code) 1055 // Map!(Long, string) dow = new HashMap!(Long, string)(); 1056 // dow.put(new Long(1L), "Mon"); 1057 // dow.put(new Long(2L), "Tue"); 1058 // dow.put(new Long(3L), "Wed"); 1059 // dow.put(new Long(4L), "Thu"); 1060 // dow.put(new Long(5L), "Fri"); 1061 // dow.put(new Long(6L), "Sat"); 1062 // dow.put(new Long(7L), "Sun"); 1063 // Map!(Long, string) moy = new HashMap!(Long, string)(); 1064 // moy.put(new Long(1L), "Jan"); 1065 // moy.put(new Long(2L), "Feb"); 1066 // moy.put(new Long(3L), "Mar"); 1067 // moy.put(new Long(4L), "Apr"); 1068 // moy.put(new Long(5L), "May"); 1069 // moy.put(new Long(6L), "Jun"); 1070 // moy.put(new Long(7L), "Jul"); 1071 // moy.put(new Long(8L), "Aug"); 1072 // moy.put(new Long(9L), "Sep"); 1073 // moy.put(new Long(10L), "Oct"); 1074 // moy.put(new Long(11L), "Nov"); 1075 // moy.put(new Long(12L), "Dec"); 1076 // DateTimeFormatter.RFC_1123_DATE_TIME = new DateTimeFormatterBuilder().parseCaseInsensitive().parseLenient() 1077 // .optionalStart().appendText(ChronoField.DAY_OF_WEEK, dow).appendLiteral(", ").optionalEnd() 1078 // .appendValue(ChronoField.DAY_OF_MONTH, 1, 2, SignStyle.NOT_NEGATIVE).appendLiteral(' ') 1079 // .appendText(ChronoField.MONTH_OF_YEAR, 1080 // moy).appendLiteral(' ').appendValue(ChronoField.YEAR, 4) // 2 digit year not handled 1081 // .appendLiteral(' ') 1082 // .appendValue(ChronoField.HOUR_OF_DAY, 2).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2) 1083 // .optionalStart().appendLiteral(':').appendValue(ChronoField.SECOND_OF_MINUTE, 1084 // 2).optionalEnd().appendLiteral(' ').appendOffset("+HHMM", 1085 // "GMT") // should handle UT/Z/EST/EDT/CST/CDT/MST/MDT/PST/MDT 1086 // .toFormatter(ResolverStyle.SMART, IsoChronology.INSTANCE); 1087 // } 1088 1089 // { 1090 // // CACHE = new HashMap!(MapEntry!(TemporalField, Locale), Object)(16, 0.75f/* , 2 */); 1091 // DateTimeTextProvider.COMPARATOR = new class Comparator!(MapEntry!(string, Long)) 1092 // { 1093 // override public int compare(MapEntry!(string, Long) obj1, MapEntry!(string, Long) obj2) 1094 // { 1095 // return cast(int)(obj2.getKey().length - obj1.getKey().length); // longest to shortest 1096 // } 1097 // }; 1098 1099 // DateTimeTextProvider.INSTANCE = new DateTimeTextProvider(); 1100 // } 1101 1102 1103 1104 // { 1105 // Instant.EPOCH = new Instant(0, 0); 1106 // Instant.MIN = Instant.ofEpochSecond(Instant.MIN_SECOND, 0); 1107 // Instant.MAX = Instant.ofEpochSecond(Instant.MAX_SECOND, 999_999_999); 1108 // } 1109 1110 // { 1111 // for (int i = 0; i < LocalTime.HOURS.length; i++) 1112 // { 1113 // LocalTime.HOURS[i] = new LocalTime(i, 0, 0, 0); 1114 // } 1115 // LocalTime.MIDNIGHT = LocalTime.HOURS[0]; 1116 // LocalTime.NOON = LocalTime.HOURS[12]; 1117 // LocalTime.MIN = LocalTime.HOURS[0]; 1118 // LocalTime.MAX = new LocalTime(23, 59, 59, 999_999_999); 1119 // } 1120 1121 // { 1122 // LocalDate.MIN = LocalDate.of(Year.MIN_VALUE, 1, 1); 1123 // LocalDate.MAX = LocalDate.of(Year.MAX_VALUE, 12, 31); 1124 // LocalDate.EPOCH = LocalDate.of(1970, 1, 1); 1125 // } 1126 1127 // { 1128 // LocalDateTime.MIN = LocalDateTime.of(LocalDate.MIN, LocalTime.MIN); 1129 // LocalDateTime.MAX = LocalDateTime.of(LocalDate.MAX, LocalTime.MAX); 1130 // } 1131 1132 // { 1133 // MonthDay.PARSER = new DateTimeFormatterBuilder().appendLiteral("--") 1134 // .appendValue(ChronoField.MONTH_OF_YEAR, 2).appendLiteral('-') 1135 // .appendValue(ChronoField.DAY_OF_MONTH, 2).toFormatter(); 1136 // } 1137 1138 // { 1139 // OffsetDateTime.MIN = LocalDateTime.MIN.atOffset(ZoneOffset.MAX); 1140 // OffsetDateTime.MAX = LocalDateTime.MAX.atOffset(ZoneOffset.MIN); 1141 // } 1142 1143 // { 1144 // OffsetTime.MIN = LocalTime.MIN.atOffset(ZoneOffset.MAX); 1145 // OffsetTime.MAX = LocalTime.MAX.atOffset(ZoneOffset.MIN); 1146 // } 1147 1148 // { 1149 // Period.ZERO = new Period(0, 0, 0); 1150 // Period.SUPPORTED_UNITS = new ArrayList!TemporalUnit(); 1151 // Period.SUPPORTED_UNITS.add(ChronoUnit.YEARS); 1152 // Period.SUPPORTED_UNITS.add(ChronoUnit.MONTHS); 1153 // Period.SUPPORTED_UNITS.add(ChronoUnit.DAYS); 1154 // } 1155 1156 // { 1157 // TemporalQueries.ZONE_ID = new class TemporalQuery!(ZoneId) 1158 // { 1159 // override public ZoneId queryFrom(TemporalAccessor temporal) 1160 // { 1161 // return QueryHelper.query!ZoneId(temporal, TemporalQueries.ZONE_ID); 1162 // } 1163 1164 // override public string toString() 1165 // { 1166 // return "ZoneId"; 1167 // } 1168 // }; 1169 1170 // /** 1171 // * A query for the {@code Chronology}. 1172 // */ 1173 // TemporalQueries.CHRONO = new class TemporalQuery!(Chronology) 1174 // { 1175 // override public Chronology queryFrom(TemporalAccessor temporal) 1176 // { 1177 // return QueryHelper.query!Chronology(temporal, TemporalQueries.CHRONO); 1178 // } 1179 1180 // override public string toString() 1181 // { 1182 // return "Chronology"; 1183 // } 1184 // }; 1185 1186 // /** 1187 // * A query for the smallest supported unit. 1188 // */ 1189 // TemporalQueries.PRECISION = new class TemporalQuery!(TemporalUnit) 1190 // { 1191 // override public TemporalUnit queryFrom(TemporalAccessor temporal) 1192 // { 1193 // return QueryHelper.query!TemporalUnit(temporal, TemporalQueries.PRECISION); 1194 // } 1195 1196 // override public string toString() 1197 // { 1198 // return "Precision"; 1199 // } 1200 // }; 1201 1202 // //----------------------------------------------------------------------- 1203 // /** 1204 // * A query for {@code ZoneOffset} returning null if not found. 1205 // */ 1206 // TemporalQueries.OFFSET = new class TemporalQuery!(ZoneOffset) 1207 // { 1208 // override public ZoneOffset queryFrom(TemporalAccessor temporal) 1209 // { 1210 // if (temporal.isSupported(ChronoField.OFFSET_SECONDS)) 1211 // { 1212 // return ZoneOffset.ofTotalSeconds(temporal.get(ChronoField.OFFSET_SECONDS)); 1213 // } 1214 // return null; 1215 // } 1216 1217 // override public string toString() 1218 // { 1219 // return "ZoneOffset"; 1220 // } 1221 // }; 1222 1223 // /** 1224 // * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}. 1225 // */ 1226 // TemporalQueries.ZONE = new class TemporalQuery!(ZoneId) 1227 // { 1228 // override public ZoneId queryFrom(TemporalAccessor temporal) 1229 // { 1230 // ZoneId zone = QueryHelper.query!ZoneId(temporal, TemporalQueries.ZONE_ID); 1231 // return (zone !is null ? zone 1232 // : QueryHelper.query!ZoneOffset(temporal, TemporalQueries.OFFSET)); 1233 // } 1234 1235 // override public string toString() 1236 // { 1237 // return "Zone"; 1238 // } 1239 // }; 1240 1241 // /** 1242 // * A query for {@code LocalDate} returning null if not found. 1243 // */ 1244 // TemporalQueries.LOCAL_DATE = new class TemporalQuery!(LocalDate) 1245 // { 1246 // override public LocalDate queryFrom(TemporalAccessor temporal) 1247 // { 1248 // if (temporal.isSupported(ChronoField.EPOCH_DAY)) 1249 // { 1250 // return LocalDate.ofEpochDay(temporal.getLong(ChronoField.EPOCH_DAY)); 1251 // } 1252 // return null; 1253 // } 1254 1255 // override public string toString() 1256 // { 1257 // return "LocalDate"; 1258 // } 1259 // }; 1260 1261 // /** 1262 // * A query for {@code LocalTime} returning null if not found. 1263 // */ 1264 // TemporalQueries.LOCAL_TIME = new class TemporalQuery!(LocalTime) 1265 // { 1266 // override public LocalTime queryFrom(TemporalAccessor temporal) 1267 // { 1268 // if (temporal.isSupported(ChronoField.NANO_OF_DAY)) 1269 // { 1270 // return LocalTime.ofNanoOfDay(temporal.getLong(ChronoField.NANO_OF_DAY)); 1271 // } 1272 // return null; 1273 // } 1274 1275 // override public string toString() 1276 // { 1277 // return "LocalTime"; 1278 // } 1279 // }; 1280 // } 1281 1282 // { 1283 // WeekFields.CACHE = new HashMap!(string, WeekFields)(4, 0.75f /* , 2 */ ); 1284 // WeekFields.ISO = new WeekFields(DayOfWeek.MONDAY, 4); 1285 // WeekFields.ISO.do_init(); 1286 // WeekFields.SUNDAY_START = WeekFields.of(DayOfWeek.SUNDAY, 1); 1287 // WeekFields.WEEK_BASED_YEARS = IsoFields.WEEK_BASED_YEARS; 1288 1289 // { 1290 // WeekFields.ComputedDayOfField.DAY_OF_WEEK_RANGE = ValueRange.of(1, 7); 1291 // WeekFields.ComputedDayOfField.WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6); 1292 // WeekFields.ComputedDayOfField.WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54); 1293 // WeekFields.ComputedDayOfField.WEEK_OF_WEEK_BASED_YEAR_RANGE = ValueRange.of(1, 52, 53); 1294 // } 1295 // } 1296 1297 // { 1298 // Calendar.cachedLocaleData = new HashMap!(Locale, int[])(3); 1299 // } 1300 1301 // { 1302 // Year.PARSER = new DateTimeFormatterBuilder().appendValue(ChronoField.YEAR, 1303 // 4, 10, SignStyle.EXCEEDS_PAD).toFormatter(); 1304 // } 1305 1306 // { 1307 // YearMonth.PARSER = new DateTimeFormatterBuilder().appendValue(ChronoField.YEAR, 4, 1308 // 10, SignStyle.EXCEEDS_PAD).appendLiteral('-') 1309 // .appendValue(ChronoField.MONTH_OF_YEAR, 2).toFormatter(); 1310 // } 1311 1312 // { 1313 // ZoneRules.EMPTY_LONG_ARRAY = new long[0]; 1314 // ZoneRules.EMPTY_LASTRULES = new ZoneOffsetTransitionRule[0]; 1315 // ZoneRules.EMPTY_LDT_ARRAY = new LocalDateTime[0]; 1316 // } 1317 1318 // { 1319 // ZoneRulesProvider.ZONE_IDS = new HashSet!string(); 1320 // ZoneRulesProvider.PROVIDERS = new ArrayList!(ZoneRulesProvider)(); 1321 // ZoneRulesProvider.ZONES = new HashMap!(string, ZoneRulesProvider)(512, 0.75f /* , 2 */ ); 1322 // ZoneRulesProvider.registerProvider(new TzdbZoneRulesProvider()); 1323 // List!(ZoneRulesProvider) loaded = new ArrayList!(ZoneRulesProvider)(); 1324 // ServiceLoader!(ZoneRulesProvider) sl; 1325 // foreach( obj ; sl.objs) 1326 // { 1327 // ZoneRulesProvider provider = obj.ctor(); 1328 // // try { 1329 // // provider = it.next(); 1330 // // } catch (ServiceConfigurationError ex) { 1331 // // if (ex.getCause(cast(SecurityException)()) !is null) { 1332 // // continue; // ignore the security exception, try the next provider 1333 // // } 1334 // // throw ex; 1335 // // } 1336 // bool found = false; 1337 // foreach(ZoneRulesProvider p ; loaded) { 1338 // if (typeid(p) == typeid(provider)) { 1339 // found = true; 1340 // } 1341 // } 1342 // if (!found) { 1343 // ZoneRulesProvider.registerProvider0(provider); 1344 // loaded.add(provider); 1345 // } 1346 // } 1347 // // CopyOnWriteList could be slow if lots of providers and each added individually 1348 // ZoneRulesProvider.PROVIDERS.addAll(loaded); 1349 // } 1350 1351 // { 1352 // ZoneId.SHORT_IDS = new HashMap!(string, string); 1353 // ZoneId.SHORT_IDS.put("ACT", "Australia/Darwin"); 1354 // ZoneId.SHORT_IDS.put("AET", "Australia/Sydney"); 1355 // ZoneId.SHORT_IDS.put("AGT", "America/Argentina/Buenos_Aires"); 1356 // ZoneId.SHORT_IDS.put("ART", "Africa/Cairo"); 1357 // ZoneId.SHORT_IDS.put("AST", "America/Anchorage"); 1358 // ZoneId.SHORT_IDS.put("BET", "America/Sao_Paulo"); 1359 // ZoneId.SHORT_IDS.put("BST", "Asia/Dhaka"); 1360 // ZoneId.SHORT_IDS.put("CAT", "Africa/Harare"); 1361 // ZoneId.SHORT_IDS.put("CNT", "America/St_Johns"); 1362 // ZoneId.SHORT_IDS.put("CST", "America/Chicago"); 1363 // ZoneId.SHORT_IDS.put("CTT", "Asia/Shanghai"); 1364 // ZoneId.SHORT_IDS.put("EAT", "Africa/Addis_Ababa"); 1365 // ZoneId.SHORT_IDS.put("ECT", "Europe/Paris"); 1366 // ZoneId.SHORT_IDS.put("IET", "America/Indiana/Indianapolis"); 1367 // ZoneId.SHORT_IDS.put("IST", "Asia/Kolkata"); 1368 // ZoneId.SHORT_IDS.put("JST", "Asia/Tokyo"); 1369 // ZoneId.SHORT_IDS.put("MIT", "Pacific/Apia"); 1370 // ZoneId.SHORT_IDS.put("NET", "Asia/Yerevan"); 1371 // ZoneId.SHORT_IDS.put("NST", "Pacific/Auckland"); 1372 // ZoneId.SHORT_IDS.put("PLT", "Asia/Karachi"); 1373 // ZoneId.SHORT_IDS.put("PNT", "America/Phoenix"); 1374 // ZoneId.SHORT_IDS.put("PRT", "America/Puerto_Rico"); 1375 // ZoneId.SHORT_IDS.put("PST", "America/Los_Angeles"); 1376 // ZoneId.SHORT_IDS.put("SST", "Pacific/Guadalcanal"); 1377 // ZoneId.SHORT_IDS.put("VST", "Asia/Ho_Chi_Minh"); 1378 // ZoneId.SHORT_IDS.put("EST", "-05:00"); 1379 // ZoneId.SHORT_IDS.put("MST", "-07:00"); 1380 // ZoneId.SHORT_IDS.put("HST", "-10:00"); 1381 1382 // } 1383 1384 // { 1385 // ZoneOffset.SECONDS_CACHE = new HashMap!(Integer, ZoneOffset)(16, 0.75f /* , 4 */ ); 1386 // ZoneOffset.ID_CACHE = new HashMap!(string, ZoneOffset)(16, 0.75f /* , 4 */ ); 1387 // ZoneOffset.UTC = ZoneOffset.ofTotalSeconds(0); 1388 // ZoneOffset.MIN = ZoneOffset.ofTotalSeconds(-ZoneOffset.MAX_SECONDS); 1389 // ZoneOffset.MAX = ZoneOffset.ofTotalSeconds(ZoneOffset.MAX_SECONDS); 1390 // } 1391 1392 // { 1393 // IsoEra.BCE = new IsoEra(0); 1394 // IsoEra.CE = new IsoEra(1); 1395 // } 1396 1397 // { 1398 // FormatStyle.FULL = new FormatStyle(0, "FULL"); 1399 // FormatStyle.LONG = new FormatStyle(1, "LONG"); 1400 // FormatStyle.MEDIUM = new FormatStyle(2, "MEDIUM"); 1401 // FormatStyle.SHORT = new FormatStyle(3, "SHORT"); 1402 // } 1403 1404 // { 1405 // TextStyle.FULL = new TextStyle(0, Calendar.LONG_FORMAT, 0); 1406 // TextStyle.FULL_STANDALONE = new TextStyle(1, Calendar.LONG_STANDALONE, 0); 1407 // TextStyle.SHORT = new TextStyle(2, Calendar.SHORT_FORMAT, 1); 1408 // TextStyle.SHORT_STANDALONE = new TextStyle(3, Calendar.SHORT_STANDALONE, 1); 1409 // TextStyle.NARROW = new TextStyle(4, Calendar.NARROW_FORMAT, 1); 1410 // TextStyle.NARROW_STANDALONE = new TextStyle(5, Calendar.NARROW_STANDALONE, 1); 1411 // TextStyle._values ~= TextStyle.FULL; 1412 // TextStyle._values ~= TextStyle.FULL_STANDALONE; 1413 // TextStyle._values ~= TextStyle.SHORT; 1414 // TextStyle._values ~= TextStyle.SHORT_STANDALONE; 1415 // TextStyle._values ~= TextStyle.NARROW; 1416 // TextStyle._values ~= TextStyle.NARROW_STANDALONE; 1417 // } 1418 1419 // { 1420 // /** 1421 // * The singleton instance for the month of January with 31 days. 1422 // * This has the numeric value of {@code 1}. 1423 // */ 1424 // Month.JANUARY = new Month(0, "JANUARY"); 1425 // Month.ENUMS ~= Month.JANUARY; 1426 // /** 1427 // * The singleton instance for the month of February with 28 days, or 29 _in a leap year. 1428 // * This has the numeric value of {@code 2}. 1429 // */ 1430 // Month.FEBRUARY = new Month(1, "FEBRUARY"); 1431 // Month.ENUMS ~= Month.FEBRUARY; 1432 // /** 1433 // * The singleton instance for the month of March with 31 days. 1434 // * This has the numeric value of {@code 3}. 1435 // */ 1436 // Month.MARCH = new Month(2, "MARCH"); 1437 // Month.ENUMS ~= Month.MARCH; 1438 // /** 1439 // * The singleton instance for the month of April with 30 days. 1440 // * This has the numeric value of {@code 4}. 1441 // */ 1442 // Month.APRIL = new Month(3, "APRIL"); 1443 // Month.ENUMS ~= Month.APRIL; 1444 // /** 1445 // * The singleton instance for the month of May with 31 days. 1446 // * This has the numeric value of {@code 5}. 1447 // */ 1448 // Month.MAY = new Month(4, "MAY"); 1449 // Month.ENUMS ~= Month.MAY; 1450 // /** 1451 // * The singleton instance for the month of June with 30 days. 1452 // * This has the numeric value of {@code 6}. 1453 // */ 1454 // Month.JUNE = new Month(5, "JUNE"); 1455 // Month.ENUMS ~= Month.JUNE; 1456 // /** 1457 // * The singleton instance for the month of July with 31 days. 1458 // * This has the numeric value of {@code 7}. 1459 // */ 1460 // Month.JULY = new Month(6, "JULY"); 1461 // Month.ENUMS ~= Month.JULY; 1462 // /** 1463 // * The singleton instance for the month of August with 31 days. 1464 // * This has the numeric value of {@code 8}. 1465 // */ 1466 // Month.AUGUST = new Month(7, "AUGUST"); 1467 // Month.ENUMS ~= Month.AUGUST; 1468 // /** 1469 // * The singleton instance for the month of September with 30 days. 1470 // * This has the numeric value of {@code 9}. 1471 // */ 1472 // Month.SEPTEMBER = new Month(8, "SEPTEMBER"); 1473 // Month.ENUMS ~= Month.SEPTEMBER; 1474 // /** 1475 // * The singleton instance for the month of October with 31 days. 1476 // * This has the numeric value of {@code 10}. 1477 // */ 1478 // Month.OCTOBER = new Month(9, "OCTOBER"); 1479 // Month.ENUMS ~= Month.OCTOBER; 1480 // /** 1481 // * The singleton instance for the month of November with 30 days. 1482 // * This has the numeric value of {@code 11}. 1483 // */ 1484 // Month.NOVEMBER = new Month(10, "NOVEMBER"); 1485 // Month.ENUMS ~= Month.NOVEMBER; 1486 1487 // /** 1488 // * The singleton instance for the month of December with 31 days. 1489 // * This has the numeric value of {@code 12}. 1490 // */ 1491 // Month.DECEMBER = new Month(11, "DECEMBER"); 1492 1493 // Month.ENUMS ~= Month.DECEMBER; 1494 // } 1495 1496 // { 1497 // ZoneOffsetTransitionRule.TimeDefinition.UTC = new ZoneOffsetTransitionRule.TimeDefinition(0, 1498 // "UTC"); 1499 // ZoneOffsetTransitionRule.TimeDefinition.WALL = new ZoneOffsetTransitionRule.TimeDefinition(1, 1500 // "WALL"); 1501 // ZoneOffsetTransitionRule.TimeDefinition.STANDARD = new ZoneOffsetTransitionRule.TimeDefinition(2, 1502 // "STANDARD"); 1503 // ZoneOffsetTransitionRule.TimeDefinition._values 1504 // ~= ZoneOffsetTransitionRule.TimeDefinition.UTC; 1505 // ZoneOffsetTransitionRule.TimeDefinition._values 1506 // ~= ZoneOffsetTransitionRule.TimeDefinition.WALL; 1507 // ZoneOffsetTransitionRule.TimeDefinition._values 1508 // ~= ZoneOffsetTransitionRule.TimeDefinition.STANDARD; 1509 // } 1510 1511 // /* version(HUNT_DEBUG) */ trace("Init shared static this end"); 1512 // }