From 57fbdb4a706cfd766e99a823e5ee89e36f20ffef Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 21 Oct 2018 17:23:58 +0200 Subject: [PATCH] update --- readme.md | 11 ++++++++++- test/test.date.ts | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 6c42231..6ee73ae 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# smarttime +# @pushrocks/smarttime handle timeformats in smart ways @@ -26,6 +26,15 @@ Use TypeScript for best in class instellisense. Smarttime offers smart ways to deal with time. +### class ExtendedDate + +This class offers static functions to create zone speicific JavaScript dates from European formated time strings. + +```TypeScript +import { ExtendedDate } from '@pushrocks/smarttime' +const myDate: Date = ExtendedDate.fromEuropeanDate('8.6.2018') +``` + For further information read the linked docs at the top of this README. > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) diff --git a/test/test.date.ts b/test/test.date.ts index 62ed37e..2a439a8 100644 --- a/test/test.date.ts +++ b/test/test.date.ts @@ -3,12 +3,12 @@ import { expect, tap } from '@pushrocks/tapbundle'; import * as smarttime from '../ts/index'; tap.test('should create a valid JavaScript Date from European TimeStamp', async () => { - const extendedDate = smarttime.ExtendedDate.fromEuropeanDate('10.10.2018'); + const extendedDate = smarttime.ExtendedDate.fromEuropeanDate('1.6.2018'); console.log(extendedDate); }); tap.test('should create a date and time with European Format', async () => { - const extendedDate = smarttime.ExtendedDate.fromEuropeanDateAndTime('10.10.2018', '08:00:00', 'Europe/Berlin'); + const extendedDate = smarttime.ExtendedDate.fromEuropeanDateAndTime('9.8.2018', '08:00:00', 'Europe/Berlin'); console.log(extendedDate); })