fix(datetime): fix ISO format when w/out timezone data

Closes #6608
This commit is contained in:
Adam Bradley
2016-06-01 09:40:45 -05:00
parent c1ad804be8
commit 272daf2993
4 changed files with 33 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ class E2EPage {
webkitOpenSourced = '2005-06-17T11:06Z';
chromeReleased = '2008-09-02';
leapYearsSummerMonths = '';
convertedDate = '';
leapYearsArray = [2020, 2016, 2008, 2004, 2000, 1996];
@@ -39,6 +40,10 @@ class E2EPage {
this.leapYearsSummerMonths = null;
}
convertDate() {
this.convertedDate = new Date(this.myDate).toISOString();
}
}

View File

@@ -68,6 +68,18 @@
<code>Leap year, summer months: {{leapYearsSummerMonths}}</code><br>
</p>
<button (click)="clearLeapYear()">Clear Leap Years</button>
<p>
<button (click)="clearLeapYear()">Clear Leap Years</button>
</p>
<ion-item>
<ion-label>myDate: {{myDate}}</ion-label>
<ion-datetime displayFormat="MMM DD, YYYY HH:mm" [(ngModel)]="myDate"></ion-datetime>
</ion-item>
<p>
<button (click)="convertDate()">Convert myDate To Date</button>
{{convertedDate}}
</p>
</ion-content>