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

Labels/Formatters: dateLib and options should not be undefined #2556

Closed
gpbl opened this issue Oct 23, 2024 Discussed in #2541 · 0 comments
Closed

Labels/Formatters: dateLib and options should not be undefined #2556

gpbl opened this issue Oct 23, 2024 Discussed in #2541 · 0 comments

Comments

@gpbl
Copy link
Owner

gpbl commented Oct 23, 2024

Inspired by #2541, we should make label* functions type to allow the use of dateLib:

labels={{
	labelDayButton: (date, { today, selected }, options, dateLib) => {
	  let label = dateLib.format(date, "PPPP"); // this is not possible as `dateLib` is marked as `undefined` in the types
	  if (today) label = `Oggi, ${label}`;
	  if (selected) label = `${label}, selezionato`;
	  return label;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant