parmarmayur9090 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

getSelected returning string #314

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently getSelected returns a string format of the dates selected rather than 
the format specified in the Date.format.  I would expect the selected dates to 
be returned in the specified format rather than a string.  This makes it easier 
to work with for database work or other functions that require the date to be 
in a certain format.  To get around this, I modified the function as noted 
below.  

getSelected : function()
{
        var r = [];
        for(var s in this.selectedDates) {
            if (this.selectedDates[s] == true) {
                //r.push(Date.fromString(s));
                r.push(s);
            }
                }
        return r;
},

Original issue reported on code.google.com by rulonr...@gmail.com on 30 Sep 2011 at 4:56

GoogleCodeExporter commented 8 years ago
It returns Date objects which is much more flexible than returning strings. It 
seems to you that it has returned "a string format of the dates selected" 
because you use console.log or something which implicitly calls the toString() 
method on the date objects.

Original comment by kelvin.l...@gmail.com on 1 Oct 2011 at 8:02