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

[Calendar] "get date" can return formatted date #3141

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dreaming-augustin
Copy link
Contributor

$('.ui.calendar').calendar('get date');
$('.ui.calendar').calendar('get focusDate');
$('.ui.calendar').calendar('get startDate');
$('.ui.calendar').calendar('get endDate');

could so far only return a Javascript Date object.

Now, given a format argument, they return a formatted date string:

$('.ui.calendar').calendar('get date',      "YYYY-MM-DD");
$('.ui.calendar').calendar('get focusDate', "YYYY-MM-DD");
$('.ui.calendar').calendar('get startDate', "YYYY-MM-DD");
$('.ui.calendar').calendar('get endDate',   "YYYY-MM-DD");

The format string is passed to the existing formatter.

This is backward compatible as the default behaviour does not change.

It makes it convenient for developers to get exactly what they need when they need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant