@webuildbots/webuildbots-sdk 11.3.1 → 11.4.1

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.
@@ -9,7 +9,8 @@ var BlockBuilder = /** @class */ (function () {
9
9
  revision: BlockBuilder.VERSION,
10
10
  created: new Date(),
11
11
  content: {},
12
- meta: {}
12
+ meta: {},
13
+ deleted: false
13
14
  };
14
15
  }
15
16
  BlockBuilder.prototype.addTitle = function (lang, title) {
@@ -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.1",
3
+ "version": "11.4.1",
4
4
  "description": "webuildbots sdk",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",