Reputation: 8727
The jQuery datepicker (http://jqueryui.com/demos/datepicker/) uses the timezone set on the client computer, which is quite unreliable.
In my website every member already has his/her timezone chosen when they register.
So I would like to generate the local time on the server side for them based on their timezone setting and let datepicker use that, but there doesn't seem to be a way to pass it to the datepicker. I can't find any option that allows this.
Has anyone ever done this before?
Many thanks to you all.
Upvotes: 0
Views: 1979
Reputation: 1428
The DataPicker has an option to set the defaultDate: http://docs.jquery.com/UI/Datepicker#option-defaultDate - "Specify either an actual date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today."
Upvotes: 1