@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.
@@ -174,7 +174,9 @@ var ResponseService = /** @class */ (function () {
174
174
  options = {
175
175
  method: 'PUT',
176
176
  data: payload,
177
- headers: { 'Content-Type': 'multipart/form-data' }
177
+ headers: {
178
+ 'content-type': "multipart/form-data; boundary=" + payload.getBoundary()
179
+ }
178
180
  };
179
181
  _c.label = 6;
180
182
  case 6:
@@ -1,3 +1,3 @@
1
1
  export declare class Utils {
2
- static parseDate: (formValue: string, languageCode: string) => string;
2
+ static parseDate: (formValue: string, languageCode: string, checkInputDate?: number) => string;
3
3
  }
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 date = new sugar_1.Date(sugar_1.Date.create(formValue, { locale: languageCode })).short('en-GB');
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webuildbots/webuildbots-sdk",
3
- "version": "11.3.0",
3
+ "version": "11.4.0",
4
4
  "description": "webuildbots sdk",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",