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

Commit 9250fce

Browse files
author
Di Peng
committed
fixed opera date.toISOString issue
Closes #365
1 parent 9a69677 commit 9250fce

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/apis.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,13 @@ var angularString = {
764764

765765
var angularDate = {
766766
'toString':function(date){
767-
return !date ?
768-
date :
769-
date.toISOString ?
770-
date.toISOString() :
771-
padNumber(date.getUTCFullYear(), 4) + '-' +
767+
if (!date) return date;
768+
769+
var isoString = date.toISOString ? date.toISOString() : '';
770+
771+
return (isoString.length==24) ?
772+
isoString :
773+
padNumber(date.getUTCFullYear(), 4) + '-' +
772774
padNumber(date.getUTCMonth() + 1, 2) + '-' +
773775
padNumber(date.getUTCDate(), 2) + 'T' +
774776
padNumber(date.getUTCHours(), 2) + ':' +

0 commit comments

Comments
 (0)