sim-node-lib 0.0.42 → 0.0.43

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.
@@ -6,4 +6,8 @@ export declare class DateHelper {
6
6
  static dateToStringFormatBR(date: Date): string;
7
7
  static dateToStringFormat(date: Date, format: string): string;
8
8
  static getDifferenceInMinutes(startData: Date, endData: Date): number;
9
+ static isTodayFromString(date: string): boolean;
10
+ static isTodayFromDate(data: Date): boolean;
11
+ static isYesterdayString(date: string): boolean;
12
+ static isYesterdayDate(data: Date): boolean;
9
13
  }
@@ -24,5 +24,20 @@ class DateHelper {
24
24
  static getDifferenceInMinutes(startData, endData) {
25
25
  return Math.trunc((Math.abs(startData.getTime() - endData.getTime()) / 36e5) * 60);
26
26
  }
27
+ static isTodayFromString(date) {
28
+ return this.isTodayFromDate(new Date(date));
29
+ }
30
+ static isTodayFromDate(data) {
31
+ const today = new Date();
32
+ return today.toISOString().split('T')[0] === data.toISOString().split('T')[0];
33
+ }
34
+ static isYesterdayString(date) {
35
+ return this.isYesterdayDate(new Date(date));
36
+ }
37
+ static isYesterdayDate(data) {
38
+ const today = new Date();
39
+ return (new Date(today.setDate(today.getDate() - 1)).toISOString().split('T')[0] ===
40
+ data.toISOString().split('T')[0]);
41
+ }
27
42
  }
28
43
  exports.DateHelper = DateHelper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim-node-lib",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Library from SIMLabs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",