According to this documentation, http://jqueryui.com/demos/datepicker/#option-altFormat
I can set a different date format for the user to see, and a different format to actually send to the server.
However, both seem to show the same format.
Here is my code:
$("#joinda开发者_运维技巧te").datepicker({
dateFormat: $.datepicker.TIMESTAMP,
altFormat: 'yy-mm-dd'
});
And, I would want the user to see yy-mm-dd format, and send the timestamp to the server using my post request. I have switched the values of altFormat and dateFormat, but either I get yy-mm-dd in both (textbox and $_POST) or the timestamp in both.
Is there a workaround to this ?
I think you must read this
The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function
Reference:
http://api.jqueryui.com/datepicker/#option-altField
精彩评论