[jQuery] Re: How to get a 'fresh' ui datepicker date?

2008-04-11 Thread Jacky See
Turn out that the _getDate() will fall back to today when not found. So I need to manually parse it and thus calling _setDateFromField doesn't matter... $.fn.getInputDate = function(){ var elem = this[0]; if(elem){ var inst = $.datepicker._getInst(elem._calId);

[jQuery] Re: How to get a 'fresh' ui datepicker date?

2008-04-11 Thread Jacky See
The above code has some error. Here is my final solution: write another plugin to get the date. HTML: Plan Date: to Actual Date: to JS: $("#dateRange input").datepickerRange({showOn:'button'}); /* Update datepicker if found and return the date */ $.fn.getInputDate = function()

[jQuery] Re: How to get a 'fresh' ui datepicker date?

2008-04-10 Thread Jacky See
I have found some wicked way to do it. This is the code where I'm writing a plugin to accept date range pair and auto-init them. //Assuming from/to date have same prefix id (e.g. #eventFromDate, #eventToDate) $.fn.datepickerPair = function(options){ return this.datepicker( $.extend({