@webuildbots/webuildbots-sdk 11.3.0 → 11.4.0
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/lib/services/ResponseService.js +3 -1
- package/lib/util/utils.d.ts +1 -1
- package/lib/util/utils.js +18 -2
- package/package.json +1 -1
|
@@ -174,7 +174,9 @@ var ResponseService = /** @class */ (function () {
|
|
|
174
174
|
options = {
|
|
175
175
|
method: 'PUT',
|
|
176
176
|
data: payload,
|
|
177
|
-
headers: {
|
|
177
|
+
headers: {
|
|
178
|
+
'content-type': "multipart/form-data; boundary=" + payload.getBoundary()
|
|
179
|
+
}
|
|
178
180
|
};
|
|
179
181
|
_c.label = 6;
|
|
180
182
|
case 6:
|
package/lib/util/utils.d.ts
CHANGED
package/lib/util/utils.js
CHANGED
|
@@ -5,9 +5,25 @@ var sugar_1 = require("sugar");
|
|
|
5
5
|
var Utils = /** @class */ (function () {
|
|
6
6
|
function Utils() {
|
|
7
7
|
}
|
|
8
|
-
Utils.parseDate = function (formValue, languageCode) {
|
|
8
|
+
Utils.parseDate = function (formValue, languageCode, checkInputDate) {
|
|
9
9
|
sugar_1.Date.setLocale('en-GB');
|
|
10
|
-
var
|
|
10
|
+
var sugarOptions = {
|
|
11
|
+
locale: languageCode,
|
|
12
|
+
past: false,
|
|
13
|
+
future: false
|
|
14
|
+
};
|
|
15
|
+
if (checkInputDate) {
|
|
16
|
+
if (checkInputDate < 0) {
|
|
17
|
+
sugarOptions.past = true;
|
|
18
|
+
}
|
|
19
|
+
else if (checkInputDate > 0) {
|
|
20
|
+
sugarOptions.future = true;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// defaults will be fine.
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
var date = new sugar_1.Date(sugar_1.Date.create(formValue, sugarOptions)).short('en-GB');
|
|
11
27
|
return date.raw;
|
|
12
28
|
};
|
|
13
29
|
return Utils;
|