@pallasoft/ps-utilities 2.0.0 → 2.1.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.
@@ -9,6 +9,9 @@ export declare class DateService {
9
9
  static getNextMonth(): string;
10
10
  static getNextYear(): string;
11
11
  static formatDate(date: string | number, format: string): string;
12
+ static formatDateInTimezone(date: string | number, zone: string, format: string): string;
13
+ static calendarDateInTimezone(date: string | number, zone: string): string;
14
+ static todayInTimezone(zone: string): string;
12
15
  static formatDateToString(date: string | number, short?: boolean): string;
13
16
  static formatTimeToString(date: string | number, short?: boolean): string;
14
17
  static diffInMins(startDate: string | number, endDate: string | number): number;
@@ -65,6 +65,15 @@ var DateService = /** @class */ (function () {
65
65
  DateService.formatDate = function (date, format) {
66
66
  return (0, dayjs_1.default)(date).format(format);
67
67
  };
68
+ DateService.formatDateInTimezone = function (date, zone, format) {
69
+ return (0, dayjs_1.default)(date).tz(zone).format(format);
70
+ };
71
+ DateService.calendarDateInTimezone = function (date, zone) {
72
+ return (0, dayjs_1.default)(date).tz(zone).format('YYYY-MM-DD');
73
+ };
74
+ DateService.todayInTimezone = function (zone) {
75
+ return (0, dayjs_1.default)().tz(zone).format('YYYY-MM-DD');
76
+ };
68
77
  DateService.formatDateToString = function (date, short) {
69
78
  return (0, dayjs_1.default)(date).format(short ? 'DD MMM, YYYY' : 'DD MMMM, YYYY');
70
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-utilities",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",