Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fixed opera date.toISOString issue
Browse files Browse the repository at this point in the history
Closes #365
  • Loading branch information
Di Peng committed Jun 3, 2011
1 parent 9a69677 commit 9250fce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,13 @@ var angularString = {

var angularDate = {
'toString':function(date){
return !date ?
date :
date.toISOString ?
date.toISOString() :
padNumber(date.getUTCFullYear(), 4) + '-' +
if (!date) return date;

var isoString = date.toISOString ? date.toISOString() : '';

return (isoString.length==24) ?
isoString :
padNumber(date.getUTCFullYear(), 4) + '-' +
padNumber(date.getUTCMonth() + 1, 2) + '-' +
padNumber(date.getUTCDate(), 2) + 'T' +
padNumber(date.getUTCHours(), 2) + ':' +
Expand Down

0 comments on commit 9250fce

Please sign in to comment.