parmarmayur9090 / jquery-datepicker

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

asString to have DayName format option, solution provided #199

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
If you want to use asString in date.js to get a day name such as "Monday"
there is no option

What version of the datepicker are you using? On what operating system? And
Which Browser?

Please provide any additional information below.
I have this suggestion, one line added to the function:
.split('ee').join(this.getDayName())

to make the function now:
add("asString", function(format) {
        var r = format || Date.format;
        return r
            .split('yyyy').join(this.getFullYear())
            .split('yy').join((this.getFullYear() + '').substring(2))
            .split('mmmm').join(this.getMonthName(false))
            .split('mmm').join(this.getMonthName(true))
            .split('mm').join(_zeroPad(this.getMonth()+1))
            .split('dd').join(_zeroPad(this.getDate()))
            .split('ee').join(this.getDayName())
            .split('hh').join(_zeroPad(this.getHours()))
            .split('min').join(_zeroPad(this.getMinutes()))
            .split('ss').join(_zeroPad(this.getSeconds()));

    });

The 'ee' format is arbitrary but similar to the method used here:
http://www.mattkruse.com/javascript/date/source.html

Original issue reported on code.google.com by artifici...@googlemail.com on 20 Apr 2010 at 2:12