need4deed-sdk 0.0.178 → 0.0.179

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.
@@ -1,4 +1,6 @@
1
1
  export declare function isBerlinPublicHoliday(date: Date): boolean;
2
2
  export declare function isWorkingDay(date: Date): boolean;
3
3
  export declare function addWorkingDays(from: Date, days: number): Date;
4
+ export declare const MIN_APPOINTMENT_WORKING_DAYS = 7;
4
5
  export declare function berlinToday(): Date;
6
+ export declare function minAppointmentDay(today?: Date): Date;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MIN_APPOINTMENT_WORKING_DAYS = void 0;
3
4
  exports.isBerlinPublicHoliday = isBerlinPublicHoliday;
4
5
  exports.isWorkingDay = isWorkingDay;
5
6
  exports.addWorkingDays = addWorkingDays;
6
7
  exports.berlinToday = berlinToday;
8
+ exports.minAppointmentDay = minAppointmentDay;
7
9
  function easterSunday(year) {
8
10
  const a = year % 19;
9
11
  const b = Math.floor(year / 100);
@@ -71,6 +73,7 @@ function addWorkingDays(from, days) {
71
73
  }
72
74
  return result;
73
75
  }
76
+ exports.MIN_APPOINTMENT_WORKING_DAYS = 7;
74
77
  const berlinDateFormat = new Intl.DateTimeFormat("en-US", {
75
78
  timeZone: "Europe/Berlin",
76
79
  year: "numeric",
@@ -83,3 +86,6 @@ function berlinToday() {
83
86
  .map(({ type, value }) => [type, Number(value)]));
84
87
  return new Date(parts.year, parts.month - 1, parts.day);
85
88
  }
89
+ function minAppointmentDay(today = berlinToday()) {
90
+ return addWorkingDays(today, exports.MIN_APPOINTMENT_WORKING_DAYS);
91
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "need4deed-sdk",
3
- "version": "0.0.178",
3
+ "version": "0.0.179",
4
4
  "description": "Need4Deed.org SDK",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",