Skip to content

Commit 00a7924

Browse files
authored
Merge pull request #42 from nncl/1.9.3-alfa
1.9.3 alfa
2 parents 75f4252 + 6ee211d commit 00a7924

File tree

11 files changed

+52
-21
lines changed

11 files changed

+52
-21
lines changed

angular.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"schematics": {
99
"@schematics/angular:component": {
1010
"style": "scss"
11+
},
12+
"@schematics/angular:application": {
13+
"strict": true
1114
}
1215
},
1316
"root": "",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-datepicker",
3-
"version": "1.9.2",
3+
"version": "1.9.3",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

projects/ngxdatepicker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clmeida/ngxdatepicker",
3-
"version": "1.9.2",
3+
"version": "1.9.3",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/nncl/ngx-datepicker"

projects/ngxdatepicker/src/lib/ngxdatepicker.component.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,19 @@ export class NgxdatepickerComponent implements OnInit, ControlValueAccessor, OnC
8484
@Output() dateClicked = new EventEmitter<string>();
8585
@Input() invalidDates: string[] = [];
8686
@Input() validDates: string[] = [];
87+
// @ts-ignore
8788
@Input() disablePrevDates;
89+
90+
// tslint:disable-next-line:no-any
8891
weeks: any[] = Array.from(Array(7).keys(), (n) => {
8992
return { weekday: n, days: [] };
9093
});
9194
current: Moment;
95+
// tslint:disable-next-line:no-any
9296
previous: any;
97+
// tslint:disable-next-line:no-any
9398
next: any;
99+
// @ts-ignore
94100
selected: IDay;
95101
val = '';
96102

@@ -104,9 +110,11 @@ export class NgxdatepickerComponent implements OnInit, ControlValueAccessor, OnC
104110
}
105111
}
106112

107-
onChange: any = (a, b) => {
113+
// tslint:disable-next-line:no-any
114+
onChange: any = () => {
108115
};
109116

117+
// tslint:disable-next-line:no-any
110118
onTouch: any = () => {
111119
};
112120

@@ -128,7 +136,7 @@ export class NgxdatepickerComponent implements OnInit, ControlValueAccessor, OnC
128136
this.selected = {
129137
day: day.format(),
130138
weekday: parseInt(day.format('d'), 10),
131-
disabled: null,
139+
disabled: false,
132140
selected: true,
133141
};
134142

@@ -140,16 +148,19 @@ export class NgxdatepickerComponent implements OnInit, ControlValueAccessor, OnC
140148
}
141149

142150
// this method sets the value programmatically
151+
// tslint:disable-next-line:no-any
143152
writeValue(value: any) {
144153
this.value = value;
145154
}
146155

147156
// upon UI element value changes, this method gets triggered
157+
// tslint:disable-next-line:no-any
148158
registerOnChange(fn: any) {
149159
this.onChange = fn;
150160
}
151161

152162
// upon touching the element, this method gets triggered
163+
// tslint:disable-next-line:no-any
153164
registerOnTouched(fn: any) {
154165
this.onTouch = fn;
155166
}
@@ -235,6 +246,7 @@ export class NgxdatepickerComponent implements OnInit, ControlValueAccessor, OnC
235246
this.matchDays(days);
236247
}
237248

249+
// tslint:disable-next-line:no-any
238250
matchDays(days: any[]) {
239251
this.weeks.map((week) => {
240252
week.days = days.filter((day) => week.weekday === day.weekday);
@@ -275,7 +287,8 @@ export class NgxdatepickerComponent implements OnInit, ControlValueAccessor, OnC
275287
addClass() {
276288
// Set selected class
277289
this.weeks = this.weeks.map((week) => {
278-
week.days = week.days.map((dayItem) => {
290+
// tslint:disable-next-line:no-any
291+
week.days = week.days.map((dayItem: any) => {
279292
return {
280293
...dayItem,
281294
selected: dayItem.day === this.selected?.day,
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
@use "sass:math";
2+
13
@function calculateRem($size) {
2-
$remSize: $size / 16px;
4+
$remSize: math.div($size, 16px);
35
@return #{$remSize}rem;
46
}

projects/ngxdatepicker/tsconfig.lib.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../out-tsc/lib",
5+
"forceConsistentCasingInFileNames": true,
6+
"strict": true,
7+
"noImplicitReturns": true,
8+
"noFallthroughCasesInSwitch": true,
59
"declarationMap": true,
610
"target": "es2015",
711
"declaration": true,
@@ -17,7 +21,9 @@
1721
"strictMetadataEmit": true,
1822
"fullTemplateTypeCheck": true,
1923
"strictInjectionParameters": true,
20-
"enableResourceInlining": true
24+
"enableResourceInlining": true,
25+
"strictInputAccessModifiers": true,
26+
"strictTemplates": true
2127
},
2228
"exclude": [
2329
"src/test.ts",

projects/ngxdatepicker/tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../../tslint.json",
33
"rules": {
4+
"no-any": true,
45
"directive-selector": [
56
true,
67
"attribute",

src/app/app.component.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ export class AppComponent implements OnInit {
1212
invalidDates: string[] = [];
1313
validDates: string[] = [];
1414

15-
date: string;
16-
model: any = moment('29/11/2020', 'DD/MM/YYYY').format();
15+
date = '';
16+
model = moment('29/11/2020', 'DD/MM/YYYY').format();
1717

18-
date2: string;
19-
model2: any = moment('25/12/2020', 'DD/MM/YYYY').format();
18+
date2 = '';
19+
model2 = moment('25/12/2020', 'DD/MM/YYYY').format();
2020

21-
date3: string;
22-
model3: any = moment('25/12/2020', 'DD/MM/YYYY').format();
21+
date3 = '';
22+
model3 = moment('25/12/2020', 'DD/MM/YYYY').format();
2323

24-
date4: string;
25-
model4: any = moment().format();
24+
date4 = '';
25+
model4 = moment().format();
2626

27-
date5: string;
28-
model5: any = moment().format();
27+
date5 = '';
28+
model5 = moment().format();
2929

3030
ngOnInit() {
3131
const tomorrow = moment().add(1, 'days').format();

tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"compilerOptions": {
44
"baseUrl": "./",
55
"outDir": "./dist/out-tsc",
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
8+
"noImplicitReturns": true,
69
"sourceMap": true,
710
"declaration": false,
811
"downlevelIteration": true,
@@ -29,6 +32,8 @@
2932
},
3033
"angularCompilerOptions": {
3134
"fullTemplateTypeCheck": true,
32-
"strictInjectionParameters": true
35+
"strictInjectionParameters": true,
36+
"strictInputAccessModifiers": true,
37+
"strictTemplates": true,
3338
}
3439
}

0 commit comments

Comments
 (0)