Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 39bff2f

Browse files
committed
moving code from constructor to on init
1 parent 733737f commit 39bff2f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-angular-components",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "Reusable responsive angular components",
55
"author": "Renovo Development Team",
66
"keywords": [

source/components/inputs/dateTime/dateTime.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,27 @@ export class DateTimeComponent extends ValidatedInputComponent<moment.Moment> im
4343
validFormat: boolean;
4444
format: string;
4545
timezone: __timezone.ITimezone;
46-
private timezoneService: __timezone.ITimezoneService;
47-
private dateService: __date.IDateUtility;
4846
private rendering: boolean = false;
4947
private touchspin: JQuery;
5048

51-
constructor(timezoneService: __timezone.TimezoneService
52-
, dateService: __date.DateUtility
49+
constructor(private timezoneService: __timezone.TimezoneService
50+
, private dateService: __date.DateUtility
5351
, @Optional() rlForm: FormComponent
5452
, componentValidator: ComponentValidator
5553
, object: __object.ObjectUtility
5654
, array: __array.ArrayUtility
5755
, guid: __guid.GuidService) {
5856
super(rlForm, componentValidator, object, array, guid);
59-
this.inputType = 'dateTime';
60-
this.timezoneService = timezoneService;
61-
this.dateService = dateService;
62-
this.timezone = this.timezoneService.currentTimezone;
6357
}
6458

6559
focus(): void {
6660
this.dateinput.nativeElement.focus();
6761
}
6862

6963
ngOnInit(): void {
64+
this.inputType = 'dateTime';
65+
this.timezone = this.timezoneService.currentTimezone;
66+
7067
if (this.validators == null) {
7168
this.validators = [];
7269
}

0 commit comments

Comments
 (0)