Skip to content

Commit e08b62d

Browse files
committed
chore: update 'calendar' demo for nativescript-ui-calendar v6.1.0
1 parent c3f91bc commit e08b62d

4 files changed

Lines changed: 52 additions & 10 deletions

File tree

calendar/app/calendar/calendar-styles.service.ts

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export class CalendarStylesService {
5151
dayCellStyle.eventFontName = this._preferredFontName;
5252
dayCellStyle.eventFontStyle = CalendarFontStyle.BoldItalic;
5353
dayCellStyle.eventTextSize = 8;
54-
dayCellStyle.cellAlignment = CalendarCellAlignment.VerticalCenter;
5554
dayCellStyle.cellPaddingHorizontal = 10;
5655
dayCellStyle.cellPaddingVertical = 5;
5756
dayCellStyle.cellBackgroundColor = this._lightGreenColor;
@@ -63,12 +62,45 @@ export class CalendarStylesService {
6362
dayCellStyle.cellTextSize = 10;
6463
monthViewStyle.dayCellStyle = dayCellStyle;
6564

65+
const anotherMonthCellStyle = new DayCellStyle();
66+
anotherMonthCellStyle.showEventsText = true;
67+
anotherMonthCellStyle.eventTextColor = this._lightGrayColor;
68+
anotherMonthCellStyle.eventFontName = this._preferredFontName;
69+
anotherMonthCellStyle.eventFontStyle = CalendarFontStyle.BoldItalic;
70+
anotherMonthCellStyle.eventTextSize = 8;
71+
anotherMonthCellStyle.cellPaddingHorizontal = 10;
72+
anotherMonthCellStyle.cellPaddingVertical = 5;
73+
anotherMonthCellStyle.cellBackgroundColor = this._lightGreenColor;
74+
anotherMonthCellStyle.cellBorderWidth = 1;
75+
anotherMonthCellStyle.cellBorderColor = this._lightYellowColor;
76+
anotherMonthCellStyle.cellTextColor = this._darkBrownColor;
77+
anotherMonthCellStyle.cellTextFontName = this._preferredFontName;
78+
anotherMonthCellStyle.cellTextFontStyle = CalendarFontStyle.Bold;
79+
anotherMonthCellStyle.cellTextSize = 10;
80+
monthViewStyle.anotherMonthCellStyle = anotherMonthCellStyle;
81+
82+
const disabledCellStyle = new DayCellStyle();
83+
disabledCellStyle.showEventsText = true;
84+
disabledCellStyle.eventTextColor = this._lightGrayColor;
85+
disabledCellStyle.eventFontName = this._preferredFontName;
86+
disabledCellStyle.eventFontStyle = CalendarFontStyle.BoldItalic;
87+
disabledCellStyle.eventTextSize = 8;
88+
disabledCellStyle.cellPaddingHorizontal = 10;
89+
disabledCellStyle.cellPaddingVertical = 5;
90+
disabledCellStyle.cellBackgroundColor = this._lightGrayColor;
91+
disabledCellStyle.cellBorderWidth = 1;
92+
disabledCellStyle.cellBorderColor = this._lightYellowColor;
93+
disabledCellStyle.cellTextColor = this._darkBrownColor;
94+
disabledCellStyle.cellTextFontName = this._preferredFontName;
95+
disabledCellStyle.cellTextFontStyle = CalendarFontStyle.Bold;
96+
disabledCellStyle.cellTextSize = 10;
97+
monthViewStyle.disabledCellStyle = disabledCellStyle;
98+
6699
const weekendCellStyle = new DayCellStyle();
67100
weekendCellStyle.eventTextColor = this._blueVioletColor;
68101
weekendCellStyle.eventFontName = this._preferredFontName;
69102
weekendCellStyle.eventFontStyle = CalendarFontStyle.BoldItalic;
70103
weekendCellStyle.eventTextSize = 8;
71-
weekendCellStyle.cellAlignment = CalendarCellAlignment.VerticalCenter;
72104
weekendCellStyle.cellPaddingHorizontal = 10;
73105
weekendCellStyle.cellPaddingVertical = 5;
74106
weekendCellStyle.cellBackgroundColor = this._orangeColor;
@@ -85,7 +117,6 @@ export class CalendarStylesService {
85117
selectedCellStyle.eventFontName = this._preferredFontName;
86118
selectedCellStyle.eventFontStyle = CalendarFontStyle.Bold;
87119
selectedCellStyle.eventTextSize = 8;
88-
selectedCellStyle.cellAlignment = CalendarCellAlignment.VerticalCenter;
89120
selectedCellStyle.cellPaddingHorizontal = 10;
90121
selectedCellStyle.cellPaddingVertical = 5;
91122
selectedCellStyle.cellBackgroundColor = this._lightBrownColor;

calendar/app/calendar/cell-styling/calendar-cell-styling.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<!-- >> angular-calendar-styling-html -->
1414
<GridLayout>
1515
<RadCalendar [monthViewStyle]="monthViewStyle" [weekViewStyle]="weekViewStyle" [monthNamesViewStyle]="monthNamesViewStyle"
16-
[yearViewStyle]="yearViewStyle" [dayViewStyle]="dayViewStyle" [viewMode]="viewMode"></RadCalendar>
16+
[yearViewStyle]="yearViewStyle" [dayViewStyle]="dayViewStyle" [viewMode]="viewMode"
17+
[minDate]="minDate" [maxDate]="maxDate" selectionMode="Single"></RadCalendar>
1718
</GridLayout>
1819
<!-- << angular-calendar-styling-html -->

calendar/app/calendar/cell-styling/calendar-cell-styling.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ export class CalendarCellStylingComponent extends OptionsExampleBase implements
6969
return this._dayViewStyle;
7070
}
7171

72+
get minDate(): Date {
73+
// 80 days ago
74+
return new Date(Date.now() - 1000 * 60 * 60 * 24 * 80);
75+
}
76+
77+
get maxDate(): Date {
78+
// in 10 days
79+
return new Date(Date.now() + 1000 * 60 * 60 * 24 * 10);
80+
}
81+
7282
onYearTap() {
7383
this._viewMode = CalendarViewMode.Year;
7484
}

calendar/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"nativescript": {
77
"id": "org.nativescript.demoangular",
88
"tns-ios": {
9-
"version": "6.2.0"
9+
"version": "6.4.0"
1010
},
1111
"tns-android": {
12-
"version": "6.2.0"
12+
"version": "6.4.0"
1313
}
1414
},
1515
"dependencies": {
@@ -21,12 +21,12 @@
2121
"@angular/platform-browser": "~8.2.0",
2222
"@angular/platform-browser-dynamic": "~8.2.0",
2323
"@angular/router": "~8.2.0",
24-
"nativescript-angular": "~8.20.0",
24+
"nativescript-angular": "~8.21.0",
2525
"nativescript-theme-core": "~1.0.4",
2626
"nativescript-ui-calendar": "*",
2727
"reflect-metadata": "~0.1.10",
2828
"rxjs": "^6.4.0",
29-
"tns-core-modules": "^6.2.0",
29+
"tns-core-modules": "^6.4.0",
3030
"zone.js": "^0.9.1"
3131
},
3232
"devDependencies": {
@@ -49,8 +49,8 @@
4949
"mochawesome": "^3.1.1",
5050
"nativescript-css-loader": "~0.26.0",
5151
"nativescript-dev-appium": "^6.0.0",
52-
"nativescript-dev-webpack": "^1.3.0",
53-
"tns-platform-declarations": "^6.2.0",
52+
"nativescript-dev-webpack": "^1.5.0",
53+
"tns-platform-declarations": "^6.4.2",
5454
"tslint": "~5.11.0",
5555
"typescript": "~3.5.3"
5656
}

0 commit comments

Comments
 (0)