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

fixed opera date.toISOString issue #367

Merged
merged 1 commit into from
Jun 3, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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