Skip to content

Commit

Permalink
fix: add better warning when defaultDateType is not set due to upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Aug 24, 2023
1 parent 9851697 commit 6cd0612
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quartz/components/Date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ interface Props {
export type ValidDateType = keyof Required<QuartzPluginData>["dates"]

export function getDate(cfg: GlobalConfiguration, data: QuartzPluginData): Date | undefined {
if (!cfg.defaultDateType) {
throw new Error(`Field 'defaultDateType' was not set in the configuration object of quartz.config.ts. See https://quartz.jzhao.xyz/configuration#general-configuration for more details.`)
}
return data.dates?.[cfg.defaultDateType]
}

Expand Down

0 comments on commit 6cd0612

Please sign in to comment.