@hapiboo/date 2.0.1 → 2.0.3

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/class.d.ts CHANGED
@@ -16,7 +16,8 @@ export declare class DateObject {
16
16
  get weekday(): number;
17
17
  toString(): string;
18
18
  toUtc(): string;
19
- toLocalDateShort(locale: string): string;
19
+ toDateShort(): string;
20
+ toLocaleDateShort(locale: string): string;
20
21
  toMonthShortString(): string;
21
22
  toWeekdayString(): string;
22
23
  private clone;
package/dist/class.js CHANGED
@@ -57,7 +57,10 @@ class DateObject {
57
57
  toUtc() {
58
58
  return this.val.toUTC().toString();
59
59
  }
60
- toLocalDateShort(locale) {
60
+ toDateShort() {
61
+ return this.val.toLocaleString(luxon_1.DateTime.DATE_SHORT);
62
+ }
63
+ toLocaleDateShort(locale) {
61
64
  return this.val.setLocale(locale).toLocaleString(luxon_1.DateTime.DATE_SHORT);
62
65
  }
63
66
  toMonthShortString() {
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DateObject } from './class';
2
2
  export declare namespace dateUtils {
3
- function checkPeriod(value: DateObject, start: DateObject, stop?: DateObject): boolean;
3
+ function checkPeriod(value: DateObject, start?: DateObject, stop?: DateObject): boolean;
4
4
  function checkDatePeriod(value: DateObject, start: DateObject, stop: DateObject): boolean;
5
5
  function checkSameYearPeriod(value: DateObject, start: DateObject, stop: DateObject): boolean;
6
6
  function checkSameDayPeriod(value: DateObject, start: DateObject, stop: DateObject): boolean;
package/dist/utils.js CHANGED
@@ -5,6 +5,9 @@ const service_1 = require("./service");
5
5
  var dateUtils;
6
6
  (function (dateUtils) {
7
7
  function checkPeriod(value, start, stop) {
8
+ if (!start) {
9
+ start = service_1.dateService.date(0, 1, 1);
10
+ }
8
11
  if (!stop) {
9
12
  stop = service_1.dateService.date(3000, 12, 31);
10
13
  }
package/package.dev.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hapiboo/date",
3
- "version": "2.0.2-dev",
3
+ "version": "2.0.4-dev",
4
4
  "description": "MK13 Studio Hapiboo - date services",
5
5
  "author": "MK13 Studio",
6
6
  "license": "ISC",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hapiboo/date",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "MK13 Studio Hapiboo - date services",
5
5
  "author": "MK13 Studio",
6
6
  "license": "ISC",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hapiboo/date",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "MK13 Studio Hapiboo - date services",
5
5
  "author": "MK13 Studio",
6
6
  "license": "ISC",
package/src/class.ts CHANGED
@@ -60,7 +60,10 @@ export class DateObject {
60
60
  toUtc(): string {
61
61
  return this.val.toUTC().toString();
62
62
  }
63
- toLocalDateShort(locale: string): string {
63
+ toDateShort(): string {
64
+ return this.val.toLocaleString(DateTime.DATE_SHORT);
65
+ }
66
+ toLocaleDateShort(locale: string): string {
64
67
  return this.val.setLocale(locale).toLocaleString(DateTime.DATE_SHORT);
65
68
  }
66
69
  toMonthShortString(): string {
package/src/utils.ts CHANGED
@@ -3,7 +3,11 @@ import { DateObject } from './class';
3
3
 
4
4
  export namespace dateUtils {
5
5
 
6
- export function checkPeriod(value: DateObject, start: DateObject, stop?: DateObject): boolean {
6
+ export function checkPeriod(value: DateObject, start?: DateObject, stop?: DateObject): boolean {
7
+ if (!start) {
8
+ start = dateService.date(0, 1, 1);
9
+ }
10
+
7
11
  if (!stop) {
8
12
  stop = dateService.date(3000, 12, 31);
9
13
  }