Skip to content

Commit

Permalink
chore(readme): update example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dysfunc committed Jan 19, 2025
1 parent d980fee commit ba1c2db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ Try it in the [Svelte REPL](https://svelte.dev/repl/cae0ce6e92634878b6e1a587146d
const toggleDatePicker = () => (isOpen = !isOpen);
const formatDate = (dateString) => {
if (isNaN(new Date(dateString))) {
return '';
}
return dateString && format(new Date(dateString), dateFormat) || '';
};
let formattedStartDate = formatDate(startDate);
const onChange = () => {
Expand Down

0 comments on commit ba1c2db

Please sign in to comment.