zavadil-ts-common 1.2.50 → 1.2.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/util/DateUtil.d.ts +2 -1
- package/package.json +1 -1
- package/src/oauth/tokenprovider/IdTokenProviderDefault.ts +1 -1
- package/src/util/DateUtil.ts +14 -2
@@ -40,7 +40,7 @@ export class IdTokenProviderDefault implements OAuthIdTokenProvider {
|
|
40
40
|
console.log("Token found, saving to storage...");
|
41
41
|
this.storage.saveIdTokenToLocalStorage(t);
|
42
42
|
// redirect if token is in url
|
43
|
-
return this.url.reset();
|
43
|
+
return this.url.reset().then(() => t);
|
44
44
|
}
|
45
45
|
);
|
46
46
|
}
|
package/src/util/DateUtil.ts
CHANGED
@@ -38,13 +38,25 @@ export class DateUtil {
|
|
38
38
|
return DateUtil.formatDateForHumans(d, true);
|
39
39
|
}
|
40
40
|
|
41
|
-
static formatDateForInput(d: any): string {
|
41
|
+
static formatDateForInput(d: any, showTime: boolean = false): string {
|
42
42
|
const date = DateUtil.parseDate(d);
|
43
43
|
if (date === undefined) return '';
|
44
44
|
const year = date.getFullYear();
|
45
45
|
const month = DateUtil.formatNumber(date.getMonth() + 1);
|
46
46
|
const day = DateUtil.formatNumber(date.getDate());
|
47
|
-
|
47
|
+
|
48
|
+
if (!showTime) {
|
49
|
+
return `${year}-${month}-${day}`;
|
50
|
+
}
|
51
|
+
|
52
|
+
const hours = DateUtil.formatNumber(d.getHours());
|
53
|
+
const minutes = DateUtil.formatNumber(d.getMinutes());
|
54
|
+
const seconds = DateUtil.formatNumber(d.getSeconds());
|
55
|
+
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
|
56
|
+
}
|
57
|
+
|
58
|
+
static formatDateTimeForInput(d: Date | string | null | undefined): string {
|
59
|
+
return DateUtil.formatDateForInput(d, true);
|
48
60
|
}
|
49
61
|
|
50
62
|
static getDurationMs(d1?: Date | string | null, d2?: Date | string | null): number | null {
|