Added more tests and bug fixes

This commit is contained in:
Giuseppe
2018-08-07 18:48:16 +02:00
parent d254c491c1
commit ffeee8f1a1
13 changed files with 1444 additions and 340 deletions

View File

@@ -1,5 +1,12 @@
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
import { isObject } from 'lodash';
export function isDateObject(value) {
return isObject(value) && value.hasOwnProperty('day')
&& value.hasOwnProperty('month') && value.hasOwnProperty('year');
}
export function dateToGMTString(date: Date | NgbDateStruct) {
let year = ((date instanceof Date) ? date.getFullYear() : date.year).toString();
let month = ((date instanceof Date) ? date.getMonth() + 1 : date.month).toString();