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
Can't format datepicker result #71
Comments
@mikeymileos : are you using moment.js to format your dates? Pikaday is configured to play nice with Moment, which you can use to produce any kind of formatting you want. |
I tried but it didn't work. Can you give me an example syntax on how to On Tue, Jun 4, 2013 at 12:47 PM, elwayman02 notifications@github.comwrote:
|
Ok, let's say that I want my date formatted to be "2013-06-01" (same as your date above). Here's what I'd do: var dateString = moment(pikaday.getDate()).format("YYYY-MM-DD"); dateString would be "2013-06-01", then. |
Ahh ok, I will try that. I had been trying things like picker.format("DD-MM-YYYY"); or picker.format I was kinda just stabbing in the dark with the first two, cause I don't On Tue, Jun 4, 2013 at 12:55 PM, elwayman02 notifications@github.comwrote:
|
By the way, I was wrong when I said that it wasn't passing the date On Tue, Jun 4, 2013 at 1:02 PM, Mikey Mileos michaelmileos@gmail.comwrote:
|
passing format: "DD-MM-YYYY" is valid in the constructor for sure...but you have to make sure that you include moment before you include pikaday so that it can access the formatting functions itself. |
Oh, I included moment after, but didn't call them til way after. It's in a On Tue, Jun 4, 2013 at 1:05 PM, elwayman02 notifications@github.com wrote:
|
Ok, as soon as I changed the include order it formatted the date (using the Thanks for your help! On Tue, Jun 4, 2013 at 1:07 PM, Mikey Mileos michaelmileos@gmail.comwrote:
|
No problem, I think there's a comment about it on the Pikaday documentation. Since Pikaday is both standalone and can use Moment, it has to know that Moment exists WHEN it's brought in as a dependency, or else it goes into standalone mode and doesn't try to use Moment. |
Ahh, I missed that part. I only saw the part where it said without moment On Tue, Jun 4, 2013 at 1:11 PM, elwayman02 notifications@github.com wrote:
|
Als see documentation in the README file and the examples in the example dir. |
Hey, thanks for making this simple and light datepicker!
I'm trying to implement it in a form in Joomla 3, and have tried several different ways to format the date it gives, but no matter what I try, I end up with something like this: "Sat Jun 01 2013".
It looks nice, but it's not in the format required to pass to this external site's page which I can't change.
Any idea on why it won't format?
The text was updated successfully, but these errors were encountered: