JQuery datepicker Difference between "dateFormat" and "altFormat"

According to this documentation http://jqueryui.com/demos/datepicker/#option-altFormat

I can set a different date format for viewing by the user and a different format for actually sending to the server.

However, both look the same.

Here is my code:

$("#joindate").datepicker({ dateFormat: $.datepicker.TIMESTAMP, altFormat: 'yy-mm-dd' }); 

And I would like the user to see the yy-mm-dd format and send the timestamp to the server using my mail request. I switched the altFormat and dateFormat values, but either get yy-mm-dd in both (text field and $ _POST), or in the timestamp in both.

Is there a workaround to this?

+7
source share
1 answer

I think you should read this.

Date The format to be used for altField . This allows you to use one date format, which will be shown to the user for selection, while another format is actually sent for the scene. For a complete list of possible formats, see formatDate Function

Link:

http://api.jqueryui.com/datepicker/#option-altField

+4
source

All Articles