Skip to content

Commit

Permalink
feat: v7.16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
heliomarpm committed Oct 15, 2023
1 parent 4ce45ab commit 442deb8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ion-calendar",
"version": "7.16.2",
"version": "7.16.3",
"scripts": {
"ng": "ng",
"prepare": "npm run build && cd dist/ion-calendar && npm link && cd ../../projects/demo && npm link @heliomarpm/ion-calendar",
Expand Down
2 changes: 1 addition & 1 deletion projects/ion-calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heliomarpm/ion-calendar",
"version": "7.16.2",
"version": "7.16.3",
"description": "A date picker super component for ionic6+",
"author": "Heliomar P. Marques",
"license": "MIT",
Expand Down
21 changes: 10 additions & 11 deletions projects/ion-calendar/src/lib/ion-calendar.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class IonCalendarService {
const isToday = DateTimeHelper.now().hasSame(date, 'day')
const dayConfig = this.findDayConfig(date, options);

var { title, subTitle, disable } = this.getCalendarDayAttributes(date, dayConfig, options);
const { title, subTitle, disable } = this.getCalendarDayAttributes(date, dayConfig, options);

return {
time,
Expand Down Expand Up @@ -184,21 +184,20 @@ export class IonCalendarService {
const dayOfWeek = DateTimeHelper.weekday(date);
disable = options.disableWeeks?.includes(dayOfWeek) || false;

if (!disable) {
if (!disable && !options.canBackwardsSelected) {
const dateFrom = options.from === undefined ? undefined : DateTimeHelper.parse(options.from).startOf("day");
const dateTo = options.to === undefined ? undefined : DateTimeHelper.parse(options.to).startOf("day");

if (!options.canBackwardsSelected) {
// Check if the date is between the specified range
if (dateFrom !== undefined && dateTo !== undefined) {
disable = !(date >= dateFrom && date <= dateTo);
} else if (dateFrom !== undefined) {
disable = date < dateFrom;
} else if (dateTo !== undefined) {
disable = date > dateTo;
}
// Check if the date is between the specified range
if (dateFrom !== undefined && dateTo !== undefined) {
disable = !(date >= dateFrom && date <= dateTo);
} else if (dateFrom !== undefined) {
disable = date < dateFrom;
} else if (dateTo !== undefined) {
disable = date > dateTo;
}
}

}

// Determine the title and subtitle for the calendar day
Expand Down

0 comments on commit 442deb8

Please sign in to comment.