ngx-st-date-format 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # NgxDateFormat
2
-
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
-
5
- ## Code scaffolding
6
-
7
- Run `ng generate component component-name --project ngx-st-date-format` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-st-date-format`.
8
- > Note: Don't forget to add `--project ngx-st-date-format` or else it will be added to the default project in your `angular.json` file.
9
-
10
- ## Build
11
-
12
- Run `ng build ngx-st-date-format` to build the project. The build artifacts will be stored in the `dist/` directory.
13
-
14
- ## Publishing
15
-
16
- After building your library with `ng build ngx-st-date-format`, go to the dist folder `cd dist/ngx-st-date-format` and run `npm publish`.
17
-
18
- ## Running unit tests
19
-
20
- Run `ng test ngx-st-date-format` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
-
22
- ## Further help
23
-
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
1
+ # NgxDateFormat
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project ngx-st-date-format` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-st-date-format`.
8
+ > Note: Don't forget to add `--project ngx-st-date-format` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build ngx-st-date-format` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build ngx-st-date-format`, go to the dist folder `cd dist/ngx-st-date-format` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test ngx-st-date-format` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -2,15 +2,21 @@ import { Pipe } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export class DateFormatPipe {
4
4
  transform(value) {
5
- return value && new Date(value).toLocaleDateString();
5
+ if (value && typeof value === 'string') {
6
+ return new Date(value).toLocaleDateString();
7
+ }
8
+ else if (value && value instanceof Date) {
9
+ return value.toLocaleDateString();
10
+ }
11
+ return '';
6
12
  }
7
13
  }
8
- DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
9
- DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, name: "stDateFormatPipe" });
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, decorators: [{
14
+ DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
15
+ DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, name: "stDateFormatPipe" });
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, decorators: [{
11
17
  type: Pipe,
12
18
  args: [{
13
19
  name: 'stDateFormatPipe',
14
20
  }]
15
21
  }] });
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1mb3JtYXQucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL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pbnN0YW5jZW9mIERhdGUpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlLnRvTG9jYWxlRGF0ZVN0cmluZygpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gJyc7XHJcbiAgICB9XHJcbn1cclxuIl19
@@ -5,9 +5,9 @@ export class DateTimeFormatPipe {
5
5
  return value && new Date(value).toLocaleString();
6
6
  }
7
7
  }
8
- DateTimeFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
9
- DateTimeFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, name: "stDateTimeFormatPipe" });
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, decorators: [{
8
+ DateTimeFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
9
+ DateTimeFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, name: "stDateTimeFormatPipe" });
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, decorators: [{
11
11
  type: Pipe,
12
12
  args: [{
13
13
  name: 'stDateTimeFormatPipe',
@@ -4,12 +4,12 @@ import { DateTimeFormatPipe } from "./pipes/date-time-format.pipe";
4
4
  import * as i0 from "@angular/core";
5
5
  export class StDateFormatModule {
6
6
  }
7
- StDateFormatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
- StDateFormatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, declarations: [DateFormatPipe,
7
+ StDateFormatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
+ StDateFormatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, declarations: [DateFormatPipe,
9
9
  DateTimeFormatPipe], exports: [DateFormatPipe,
10
10
  DateTimeFormatPipe] });
11
- StDateFormatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, providers: [], imports: [[]] });
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, decorators: [{
11
+ StDateFormatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule });
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, decorators: [{
13
13
  type: NgModule,
14
14
  args: [{
15
15
  imports: [],
@@ -24,4 +24,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
24
24
  providers: []
25
25
  }]
26
26
  }] });
27
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3QtZGF0ZS1mb3JtYXQubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXN0LWRhdGUtZm9ybWF0L3NyYy9saWIvc3QtZGF0ZS1mb3JtYXQubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwib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hbmd1bGFyL2NvcmVcIjtcclxuaW1wb3J0IHtEYXRlRm9ybWF0UGlwZX0gZnJvbSBcIi4vcGlwZXMvZGF0ZS1mb3JtYXQucGlwZVwiO1xyXG5pbXBvcnQge0RhdGVUaW1lRm9ybWF0UGlwZX0gZnJvbSBcIi4vcGlwZXMvZGF0ZS10aW1lLWZvcm1hdC5waXBlXCI7XHJcblxyXG5ATmdNb2R1bGUoe1xyXG4gICAgaW1wb3J0czogW10sXHJcbiAgICBkZWNsYXJhdGlvbnM6IFtcclxuICAgICAgICBEYXRlRm9ybWF0UGlwZSxcclxuICAgICAgICBEYXRlVGltZUZvcm1hdFBpcGVcclxuICAgIF0sXHJcbiAgICBleHBvcnRzOiBbXHJcbiAgICAgICAgRGF0ZUZvcm1hdFBpcGUsXHJcbiAgICAgICAgRGF0ZVRpbWVGb3JtYXRQaXBlXHJcbiAgICBdLFxyXG4gICAgcHJvdmlkZXJzOiBbXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgU3REYXRlRm9ybWF0TW9kdWxlIHtcclxuXHJcbn1cclxuIl19
@@ -4,4 +4,4 @@
4
4
  export * from './lib/pipes/date-format.pipe';
5
5
  export * from './lib/pipes/date-time-format.pipe';
6
6
  export * from './lib/st-date-format.module';
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1zdC1kYXRlLWZvcm1hdC9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYyxtQ0FBbUMsQ0FBQztBQUNsRCxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBuZ3gtc3QtZGF0ZS1mb3JtYXRcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9waXBlcy9kYXRlLWZvcm1hdC5waXBlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3BpcGVzL2RhdGUtdGltZS1mb3JtYXQucGlwZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdC1kYXRlLWZvcm1hdC5tb2R1bGUnO1xuIl19
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1zdC1kYXRlLWZvcm1hdC9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYyxtQ0FBbUMsQ0FBQztBQUNsRCxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIG5neC1zdC1kYXRlLWZvcm1hdFxyXG4gKi9cclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3BpcGVzL2RhdGUtZm9ybWF0LnBpcGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9waXBlcy9kYXRlLXRpbWUtZm9ybWF0LnBpcGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdC1kYXRlLWZvcm1hdC5tb2R1bGUnO1xyXG4iXX0=
@@ -3,12 +3,18 @@ import { Pipe, NgModule } from '@angular/core';
3
3
 
4
4
  class DateFormatPipe {
5
5
  transform(value) {
6
- return value && new Date(value).toLocaleDateString();
6
+ if (value && typeof value === 'string') {
7
+ return new Date(value).toLocaleDateString();
8
+ }
9
+ else if (value && value instanceof Date) {
10
+ return value.toLocaleDateString();
11
+ }
12
+ return '';
7
13
  }
8
14
  }
9
- DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
10
- DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, name: "stDateFormatPipe" });
11
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, decorators: [{
15
+ DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
16
+ DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, name: "stDateFormatPipe" });
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, decorators: [{
12
18
  type: Pipe,
13
19
  args: [{
14
20
  name: 'stDateFormatPipe',
@@ -20,9 +26,9 @@ class DateTimeFormatPipe {
20
26
  return value && new Date(value).toLocaleString();
21
27
  }
22
28
  }
23
- DateTimeFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
24
- DateTimeFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, name: "stDateTimeFormatPipe" });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, decorators: [{
29
+ DateTimeFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
30
+ DateTimeFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, name: "stDateTimeFormatPipe" });
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, decorators: [{
26
32
  type: Pipe,
27
33
  args: [{
28
34
  name: 'stDateTimeFormatPipe',
@@ -31,12 +37,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
31
37
 
32
38
  class StDateFormatModule {
33
39
  }
34
- StDateFormatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
35
- StDateFormatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, declarations: [DateFormatPipe,
40
+ StDateFormatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
41
+ StDateFormatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, declarations: [DateFormatPipe,
36
42
  DateTimeFormatPipe], exports: [DateFormatPipe,
37
43
  DateTimeFormatPipe] });
38
- StDateFormatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, providers: [], imports: [[]] });
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, decorators: [{
44
+ StDateFormatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule });
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, decorators: [{
40
46
  type: NgModule,
41
47
  args: [{
42
48
  imports: [],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-st-date-format.mjs","sources":["../../../projects/ngx-st-date-format/src/lib/pipes/date-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/pipes/date-time-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/st-date-format.module.ts","../../../projects/ngx-st-date-format/src/public-api.ts","../../../projects/ngx-st-date-format/src/ngx-st-date-format.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateFormatPipe',\r\n})\r\nexport class DateFormatPipe implements PipeTransform {\r\n transform(value: string) {\r\n return value && new Date(value).toLocaleDateString();\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateTimeFormatPipe',\r\n})\r\nexport class DateTimeFormatPipe implements PipeTransform {\r\n transform(value: string) {\r\n return value && new Date(value).toLocaleString();\r\n }\r\n}\r\n","import {NgModule} from \"@angular/core\";\r\nimport {DateFormatPipe} from \"./pipes/date-format.pipe\";\r\nimport {DateTimeFormatPipe} from \"./pipes/date-time-format.pipe\";\r\n\r\n@NgModule({\r\n imports: [],\r\n declarations: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n exports: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n providers: []\r\n})\r\nexport class StDateFormatModule {\r\n\r\n}\r\n","/*\n * Public API Surface of ngx-st-date-format\n */\n\nexport * from './lib/pipes/date-format.pipe';\nexport * from './lib/pipes/date-time-format.pipe';\nexport * from './lib/st-date-format.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,cAAc,CAAA;AACvB,IAAA,SAAS,CAAC,KAAa,EAAA;QACnB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AA,OAAA,EAAA,CATJ,EAAE,CAAA,EAAA,CAAA,CAAA;2FAWF,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE;wBACV,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,SAAS,EAAE,EAAE;iBAChB,CAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-st-date-format.mjs","sources":["../../../projects/ngx-st-date-format/src/lib/pipes/date-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/pipes/date-time-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/st-date-format.module.ts","../../../projects/ngx-st-date-format/src/public-api.ts","../../../projects/ngx-st-date-format/src/ngx-st-date-format.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateFormatPipe',\r\n})\r\nexport class DateFormatPipe implements PipeTransform {\r\n transform(value: string | Date) {\r\n\r\n if (value && typeof value === 'string') {\r\n return new Date(value).toLocaleDateString();\r\n } else if (value && value instanceof Date) {\r\n return value.toLocaleDateString()\r\n }\r\n\r\n return '';\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateTimeFormatPipe',\r\n})\r\nexport class DateTimeFormatPipe implements PipeTransform {\r\n transform(value: string) {\r\n return value && new Date(value).toLocaleString();\r\n }\r\n}\r\n","import {NgModule} from \"@angular/core\";\r\nimport {DateFormatPipe} from \"./pipes/date-format.pipe\";\r\nimport {DateTimeFormatPipe} from \"./pipes/date-time-format.pipe\";\r\n\r\n@NgModule({\r\n imports: [],\r\n declarations: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n exports: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n providers: []\r\n})\r\nexport class StDateFormatModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of ngx-st-date-format\r\n */\r\n\r\nexport * from './lib/pipes/date-format.pipe';\r\nexport * from './lib/pipes/date-time-format.pipe';\r\nexport * from './lib/st-date-format.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,cAAc,CAAA;AACvB,IAAA,SAAS,CAAC,KAAoB,EAAA;AAE1B,QAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,OAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,kBAAkB,EAAE,CAAC;AAChD,SAAA;AAAM,aAAA,IAAI,KAAK,IAAI,KAAK,YAAY,IAAI,EAAE;AACvC,YAAA,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAA;AACpC,SAAA;AAED,QAAA,OAAO,EAAE,CAAC;KACb;;2GAVQ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,CAAA;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,kBAAkB;iBAC3B,CAAA;;;MCCY,kBAAkB,CAAA;AAC3B,IAAA,SAAS,CAAC,KAAa,EAAA;QACnB,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC;KACpD;;+GAHQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAlB,kBAAkB,EAAA,IAAA,EAAA,sBAAA,EAAA,CAAA,CAAA;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,sBAAsB;iBAC/B,CAAA;;;MCYY,kBAAkB,CAAA;;+GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,iBATvB,cAAc;AACd,QAAA,kBAAkB,aAGlB,cAAc;QACd,kBAAkB,CAAA,EAAA,CAAA,CAAA;gHAIb,kBAAkB,EAAA,CAAA,CAAA;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE;wBACV,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,SAAS,EAAE,EAAE;iBAChB,CAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -3,12 +3,18 @@ import { Pipe, NgModule } from '@angular/core';
3
3
 
4
4
  class DateFormatPipe {
5
5
  transform(value) {
6
- return value && new Date(value).toLocaleDateString();
6
+ if (value && typeof value === 'string') {
7
+ return new Date(value).toLocaleDateString();
8
+ }
9
+ else if (value && value instanceof Date) {
10
+ return value.toLocaleDateString();
11
+ }
12
+ return '';
7
13
  }
8
14
  }
9
- DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
10
- DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, name: "stDateFormatPipe" });
11
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateFormatPipe, decorators: [{
15
+ DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
16
+ DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, name: "stDateFormatPipe" });
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateFormatPipe, decorators: [{
12
18
  type: Pipe,
13
19
  args: [{
14
20
  name: 'stDateFormatPipe',
@@ -20,9 +26,9 @@ class DateTimeFormatPipe {
20
26
  return value && new Date(value).toLocaleString();
21
27
  }
22
28
  }
23
- DateTimeFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
24
- DateTimeFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, name: "stDateTimeFormatPipe" });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DateTimeFormatPipe, decorators: [{
29
+ DateTimeFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
30
+ DateTimeFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, name: "stDateTimeFormatPipe" });
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateTimeFormatPipe, decorators: [{
26
32
  type: Pipe,
27
33
  args: [{
28
34
  name: 'stDateTimeFormatPipe',
@@ -31,12 +37,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
31
37
 
32
38
  class StDateFormatModule {
33
39
  }
34
- StDateFormatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
35
- StDateFormatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, declarations: [DateFormatPipe,
40
+ StDateFormatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
41
+ StDateFormatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, declarations: [DateFormatPipe,
36
42
  DateTimeFormatPipe], exports: [DateFormatPipe,
37
43
  DateTimeFormatPipe] });
38
- StDateFormatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, providers: [], imports: [[]] });
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StDateFormatModule, decorators: [{
44
+ StDateFormatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule });
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StDateFormatModule, decorators: [{
40
46
  type: NgModule,
41
47
  args: [{
42
48
  imports: [],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-st-date-format.mjs","sources":["../../../projects/ngx-st-date-format/src/lib/pipes/date-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/pipes/date-time-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/st-date-format.module.ts","../../../projects/ngx-st-date-format/src/public-api.ts","../../../projects/ngx-st-date-format/src/ngx-st-date-format.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateFormatPipe',\r\n})\r\nexport class DateFormatPipe implements PipeTransform {\r\n transform(value: string) {\r\n return value && new Date(value).toLocaleDateString();\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateTimeFormatPipe',\r\n})\r\nexport class DateTimeFormatPipe implements PipeTransform {\r\n transform(value: string) {\r\n return value && new Date(value).toLocaleString();\r\n }\r\n}\r\n","import {NgModule} from \"@angular/core\";\r\nimport {DateFormatPipe} from \"./pipes/date-format.pipe\";\r\nimport {DateTimeFormatPipe} from \"./pipes/date-time-format.pipe\";\r\n\r\n@NgModule({\r\n imports: [],\r\n declarations: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n exports: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n providers: []\r\n})\r\nexport class StDateFormatModule {\r\n\r\n}\r\n","/*\n * Public API Surface of ngx-st-date-format\n */\n\nexport * from './lib/pipes/date-format.pipe';\nexport * from './lib/pipes/date-time-format.pipe';\nexport * from './lib/st-date-format.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,cAAc,CAAA;AACvB,IAAA,SAAS,CAAC,KAAa,EAAA;QACnB,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,kBAAkB,EAAE,CAAC;KACxD;;2GAHQ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA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YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE;wBACV,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-st-date-format.mjs","sources":["../../../projects/ngx-st-date-format/src/lib/pipes/date-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/pipes/date-time-format.pipe.ts","../../../projects/ngx-st-date-format/src/lib/st-date-format.module.ts","../../../projects/ngx-st-date-format/src/public-api.ts","../../../projects/ngx-st-date-format/src/ngx-st-date-format.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateFormatPipe',\r\n})\r\nexport class DateFormatPipe implements PipeTransform {\r\n transform(value: string | Date) {\r\n\r\n if (value && typeof value === 'string') {\r\n return new Date(value).toLocaleDateString();\r\n } else if (value && value instanceof Date) {\r\n return value.toLocaleDateString()\r\n }\r\n\r\n return '';\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'stDateTimeFormatPipe',\r\n})\r\nexport class DateTimeFormatPipe implements PipeTransform {\r\n transform(value: string) {\r\n return value && new Date(value).toLocaleString();\r\n }\r\n}\r\n","import {NgModule} from \"@angular/core\";\r\nimport {DateFormatPipe} from \"./pipes/date-format.pipe\";\r\nimport {DateTimeFormatPipe} from \"./pipes/date-time-format.pipe\";\r\n\r\n@NgModule({\r\n imports: [],\r\n declarations: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n exports: [\r\n DateFormatPipe,\r\n DateTimeFormatPipe\r\n ],\r\n providers: []\r\n})\r\nexport class StDateFormatModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of ngx-st-date-format\r\n */\r\n\r\nexport * from './lib/pipes/date-format.pipe';\r\nexport * from './lib/pipes/date-time-format.pipe';\r\nexport * from './lib/st-date-format.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,cAAc,CAAA;AACvB,IAAA,SAAS,CAAC,KAAoB,EAAA;AAE1B,QAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,OAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,kBAAkB,EAAE,CAAC;AAChD,SAAA;AAAM,aAAA,IAAI,KAAK,IAAI,KAAK,YAAY,IAAI,EAAE;AACvC,YAAA,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAA;AACpC,SAAA;AAED,QAAA,OAAO,EAAE,CAAC;KACb;;2GAVQ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,CAAA;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,kBAAkB;AAC3B,iBAAA,CAAA;;;MCCY,kBAAkB,CAAA;AAC3B,IAAA,SAAS,CAAC,KAAa,EAAA;QACnB,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC;KACpD;;+GAHQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAlB,kBAAkB,EAAA,IAAA,EAAA,sBAAA,EAAA,CAAA,CAAA;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,sBAAsB;AAC/B,iBAAA,CAAA;;;MCYY,kBAAkB,CAAA;;+GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,iBATvB,cAAc;AACd,QAAA,kBAAkB,aAGlB,cAAc;QACd,kBAAkB,CAAA,EAAA,CAAA,CAAA;gHAIb,kBAAkB,EAAA,CAAA,CAAA;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE;wBACV,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,cAAc;wBACd,kBAAkB;AACrB,qBAAA;AACD,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class DateFormatPipe implements PipeTransform {
4
- transform(value: string): string;
4
+ transform(value: string | Date): string;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<DateFormatPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<DateFormatPipe, "stDateFormatPipe">;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<DateFormatPipe, "stDateFormatPipe", false>;
7
7
  }
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class DateTimeFormatPipe implements PipeTransform {
4
4
  transform(value: string): string;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeFormatPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<DateTimeFormatPipe, "stDateTimeFormatPipe">;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<DateTimeFormatPipe, "stDateTimeFormatPipe", false>;
7
7
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "ngx-st-date-format",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "peerDependencies": {
5
- "@angular/common": "^13.2.0",
6
- "@angular/core": "^13.2.0"
5
+ "@angular/common": "^14.3.0",
6
+ "@angular/core": "^14.3.0"
7
7
  },
8
8
  "dependencies": {
9
9
  "tslib": "^2.3.0"
@@ -13,13 +13,13 @@
13
13
  "esm2020": "esm2020/ngx-st-date-format.mjs",
14
14
  "fesm2020": "fesm2020/ngx-st-date-format.mjs",
15
15
  "fesm2015": "fesm2015/ngx-st-date-format.mjs",
16
- "typings": "ngx-st-date-format.d.ts",
16
+ "typings": "index.d.ts",
17
17
  "exports": {
18
18
  "./package.json": {
19
19
  "default": "./package.json"
20
20
  },
21
21
  ".": {
22
- "types": "./ngx-st-date-format.d.ts",
22
+ "types": "./index.d.ts",
23
23
  "esm2020": "./esm2020/ngx-st-date-format.mjs",
24
24
  "es2020": "./fesm2020/ngx-st-date-format.mjs",
25
25
  "es2015": "./fesm2015/ngx-st-date-format.mjs",
File without changes