jitz-sharepoint-utilities 2.0.2 → 2.0.3
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.
@@ -1,5 +1,5 @@
|
|
1
1
|
export default class UtilityService {
|
2
|
-
static setCookie: (name: string, val: string) => void;
|
2
|
+
static setCookie: (name: string, val: string, validMinutes?: number) => void;
|
3
3
|
static getCookie: (name: string) => string | undefined;
|
4
4
|
static deleteCookie: (name: string) => void;
|
5
5
|
static formatDate: (date: Date) => string;
|
@@ -7,11 +7,12 @@ var UtilityService = /** @class */ (function () {
|
|
7
7
|
}
|
8
8
|
var _a;
|
9
9
|
_a = UtilityService;
|
10
|
-
UtilityService.setCookie = function (name, val) {
|
10
|
+
UtilityService.setCookie = function (name, val, validMinutes) {
|
11
|
+
if (validMinutes === void 0) { validMinutes = 604800000; }
|
11
12
|
var date = new Date();
|
12
13
|
var value = val;
|
13
14
|
// Set it expire in 7 days
|
14
|
-
date.setTime(date.getTime() +
|
15
|
+
date.setTime(date.getTime() + validMinutes);
|
15
16
|
// Set it
|
16
17
|
document.cookie =
|
17
18
|
name + "=" + value + "; expires=" + date.toUTCString() + "; path=/";
|