| 708 | } |
| 709 | |
| 710 | int64_t fromDateString( |
| 711 | const char* str, |
| 712 | size_t len, |
| 713 | bool* nullOutput, |
| 714 | bool sparkCompatible) { |
| 715 | int64_t daysSinceEpoch; |
| 716 | size_t pos = 0; |
| 717 | |
| 718 | if (tryParseDateString( |
| 719 | str, len, pos, daysSinceEpoch, kStrict, sparkCompatible) != |
| 720 | DateParseResult::kSuccess) { |
| 721 | if (nullOutput != nullptr) { |
| 722 | *nullOutput = true; |
| 723 | return 0; |
| 724 | } else { |
| 725 | BOLT_USER_FAIL( |
| 726 | "Unable to parse date value: \"{}\", expected format is (YYYY-MM-DD)", |
| 727 | std::string(str, len)); |
| 728 | } |
| 729 | } |
| 730 | return daysSinceEpoch; |
| 731 | } |
| 732 | |
| 733 | static bool isInvalidDate(int year, int month, int day) { |
| 734 | static bool MONTH_OF_31_DAYS[] = { |
nothing calls this directly
no test coverage detected