Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) O3-2489 - toDateObjectStrict returns null if the passed string is not considered a valid date #963

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion packages/framework/esm-utils/src/omrs-dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function isOmrsDateToday(date: DateInput) {
*/
export function toDateObjectStrict(omrsDateString: string): Date | null {
if (!isOmrsDateStrict(omrsDateString)) {
return null;
throw new Error(`\`toDateObjectStrict\` failed to parse date string "${omrsDateString}".`);
}

return dayjs(omrsDateString, isoFormat).toDate();
Expand Down