OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * Copyright (C) 2003-2013, International Business Machines Corporation | 3 * Copyright (C) 2003-2013, International Business Machines Corporation |
4 * and others. All Rights Reserved. | 4 * and others. All Rights Reserved. |
5 ****************************************************************************** | 5 ****************************************************************************** |
6 * | 6 * |
7 * File HEBRWCAL.CPP | 7 * File HEBRWCAL.CPP |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 | 522 |
523 /** | 523 /** |
524 * Returns the number of days in the given Hebrew year | 524 * Returns the number of days in the given Hebrew year |
525 * @internal | 525 * @internal |
526 */ | 526 */ |
527 int32_t HebrewCalendar::handleGetYearLength(int32_t eyear) const { | 527 int32_t HebrewCalendar::handleGetYearLength(int32_t eyear) const { |
528 UErrorCode status = U_ZERO_ERROR; | 528 UErrorCode status = U_ZERO_ERROR; |
529 return startOfYear(eyear+1, status) - startOfYear(eyear, status); | 529 return startOfYear(eyear+1, status) - startOfYear(eyear, status); |
530 } | 530 } |
531 | 531 |
| 532 void HebrewCalendar::validateField(UCalendarDateFields field, UErrorCode &status
) { |
| 533 if (field == UCAL_MONTH && !isLeapYear(handleGetExtendedYear()) && internalG
et(UCAL_MONTH) == ADAR_1) { |
| 534 status = U_ILLEGAL_ARGUMENT_ERROR; |
| 535 return; |
| 536 } |
| 537 Calendar::validateField(field, status); |
| 538 } |
532 //------------------------------------------------------------------------- | 539 //------------------------------------------------------------------------- |
533 // Functions for converting from milliseconds to field values | 540 // Functions for converting from milliseconds to field values |
534 //------------------------------------------------------------------------- | 541 //------------------------------------------------------------------------- |
535 | 542 |
536 /** | 543 /** |
537 * Subclasses may override this method to compute several fields | 544 * Subclasses may override this method to compute several fields |
538 * specific to each calendar system. These are: | 545 * specific to each calendar system. These are: |
539 * | 546 * |
540 * <ul><li>ERA | 547 * <ul><li>ERA |
541 * <li>YEAR | 548 * <li>YEAR |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 return gSystemDefaultCenturyStartYear; | 720 return gSystemDefaultCenturyStartYear; |
714 } | 721 } |
715 | 722 |
716 | 723 |
717 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(HebrewCalendar) | 724 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(HebrewCalendar) |
718 | 725 |
719 U_NAMESPACE_END | 726 U_NAMESPACE_END |
720 | 727 |
721 #endif // UCONFIG_NO_FORMATTING | 728 #endif // UCONFIG_NO_FORMATTING |
722 | 729 |
OLD | NEW |