Add date parsing and redirect logic for date sub-path in url

This commit is contained in:
2018-03-22 13:55:24 +05:30
parent 5ca39065dc
commit 915b00edcd
2 changed files with 55 additions and 6 deletions
+4
View File
@@ -21,6 +21,10 @@ export class Utils {
return moment.tz(moment.tz.guess()).tz("Asia/Kolkata");
}
static createSomeDateInIndiaTZ(dateString: string): moment.Moment {
return moment.tz(dateString, moment.tz.guess()).tz("Asia/Kolkata");
}
static checkSameDayInSameTZ(moment1: moment.Moment, moment2: moment.Moment, raiseErrorTZMismatch: boolean = true) {
// tslint:disable-next-line:triple-equals
if (raiseErrorTZMismatch && (moment1.tz() != moment2.tz())) {