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

FR: Datepicker instance to persistently store both a display string and a submit string that can have different formats #1190

Closed
ChrisHacker opened this issue Jul 17, 2015 · 1 comment

Comments

@ChrisHacker
Copy link

I was looking for this feature and found #1168 closed. Here's the use case for us. We store all dates in ISO format. We want to display in a variety of human readable formats which i'm clear the format option allows us to do. However, the datepicker instance doesn't both persistently store the converted ISO value as the actual input value and make both the display and submit value formats available to the DOM for calculations and printing.

@Eonasdan
Copy link
Owner

as was mentioned, in the closed issue, you can get the date from .data('').date(). You can write a hook into the submit event to change the input value or whatever you need to do to get the date in the format you need.

The plugin already provides the functions to get the date in whatever format you need with momentjs. If you need a different format server side, then convert it.

I have no plans to add a hook to the submit event since I couldn't possibly do that in a way that make everyone happy. Nor will I add another function that duplicates .date().

Repository owner locked and limited conversation to collaborators Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants