add workaround for Safari 4/5 to parse dates, fixes #2329
This commit is contained in:
parent
0044ffdbb3
commit
48ce6fc101
1 changed files with 8 additions and 1 deletions
|
@ -245,10 +245,17 @@ Ox.makeDate <f> Takes a date, number or string, returns a date
|
||||||
'01/01/1970'
|
'01/01/1970'
|
||||||
> Ox.formatDate(Ox.makeDate(new Date('01/01/1970')), '%m/%d/%Y')
|
> Ox.formatDate(Ox.makeDate(new Date('01/01/1970')), '%m/%d/%Y')
|
||||||
'01/01/1970'
|
'01/01/1970'
|
||||||
|
> Ox.formatDate(Ox.makeDate('1970-01-01'), '%Y-%m-%d')
|
||||||
|
'1970-01-01'
|
||||||
@*/
|
@*/
|
||||||
Ox.makeDate = function(date) {
|
Ox.makeDate = function(date) {
|
||||||
// if date is a date, new Date(date) makes a clone
|
// if date is a date, new Date(date) makes a clone
|
||||||
return Ox.isUndefined(date) ? new Date() : new Date(date);
|
return Ox.isUndefined(date) ? new Date() : new Date(
|
||||||
|
//Safari 4/5 does not understand YYYY-MM-DD format
|
||||||
|
$.browser.safari && $.browser.version <= '534.59.10' && Ox.isString(date)
|
||||||
|
? date.replace(/-/g, '/')
|
||||||
|
: date
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
|
|
Loading…
Reference in a new issue