@bbn/bbn 2.0.11 → 2.0.12

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/date.d.ts CHANGED
@@ -23,6 +23,8 @@ declare class bbnDateTool {
23
23
  weekdaysShort?: string[];
24
24
  }): Date;
25
25
  constructor(value: any, inputFormat?: null | String);
26
+ parse(input: string, format: string): bbnDateTool;
27
+ matchFormat(value: any, format: string): boolean;
26
28
  toString(): string;
27
29
  year(v?: number): number | bbnDateTool;
28
30
  month(v?: number): number | bbnDateTool;
package/dist/date.js CHANGED
@@ -823,6 +823,19 @@ class bbnDateTool {
823
823
  });
824
824
  }
825
825
  }
826
+ parse(input, format) {
827
+ const d = bbnDateTool.parse(input, format);
828
+ return new bbnDateTool(d);
829
+ }
830
+ matchFormat(value, format) {
831
+ try {
832
+ bbnDateTool.parse(value, format);
833
+ return true;
834
+ }
835
+ catch (_a) {
836
+ return false;
837
+ }
838
+ }
826
839
  toString() {
827
840
  return __classPrivateFieldGet(this, _bbnDateTool_value, "f") ? this.format() : '';
828
841
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",