From afd7cffbf14a058f22f6ae61f32411a825ff07a9 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 17 May 2016 09:12:05 -0500 Subject: [PATCH] docs(demos): datetime formatting updates --- demos/datetime/index.ts | 24 +++++++++--------------- demos/datetime/main.html | 27 ++++++++++++++------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/demos/datetime/index.ts b/demos/datetime/index.ts index f90cb8ae35..b207561ddd 100644 --- a/demos/datetime/index.ts +++ b/demos/datetime/index.ts @@ -7,14 +7,14 @@ import {App, Page} from 'ionic-angular'; class MainPage { wwwReleased = '1991'; netscapeReleased = '1994-12-15T13:47:20.789'; - firefoxReleased = '2002-09-23T15:03:46.789'; operaReleased = '1995-04-15'; webkitReleased = '1998-11-04T11:06Z'; + firefoxReleased = '2002-09-23T15:03:46.789'; chromeReleased = '2008-09-02'; tokyoTime: string; parisTime: string; - dallasTime: string; + madisonTime: string; alertTime = '10:15'; operaShortDay = [ @@ -28,16 +28,14 @@ class MainPage { ]; constructor() { - this.tokyoTime = this.calculateTime("+9"); - this.parisTime = this.calculateTime("+1"); - this.dallasTime = this.calculateTime("-6"); - - let today = new Date(); + this.tokyoTime = this.calculateTime('+9'); + this.parisTime = this.calculateTime('+1'); + this.madisonTime = this.calculateTime('-6'); // If it is Daylight Savings Time - if (this.dst(today)) { - this.parisTime = this.calculateTime("+2"); - this.dallasTime = this.calculateTime("-5"); + if (this.dst(new Date())) { + this.parisTime = this.calculateTime('+2'); + this.madisonTime = this.calculateTime('-5'); } } @@ -47,7 +45,7 @@ class MainPage { // create new Date object for different city // using supplied offset - let nd = new Date(d.getTime() + (3600000*offset)); + let nd = new Date(d.getTime() + (3600000 * offset)); return nd.toISOString(); } @@ -70,8 +68,4 @@ class MainPage { }) class ApiDemoApp { root = MainPage; - - constructor() { - - } } diff --git a/demos/datetime/main.html b/demos/datetime/main.html index 3607733cf4..30d1ac17a7 100644 --- a/demos/datetime/main.html +++ b/demos/datetime/main.html @@ -13,7 +13,17 @@ Netscape - + + + + + Opera + + + + + Webkit + @@ -21,16 +31,6 @@ - - Opera - - - - - Webkit - - - Chrome @@ -51,11 +51,12 @@ - Dallas - + Madison + + Set Alarm