ion2-calendar
Advanced tools
Comparing version 2.1.6-beta.1 to 2.1.6-beta.2
@@ -15,2 +15,4 @@ export interface CalendarOriginal { | ||
cssClass: string; | ||
isLastMonth?: boolean; | ||
isNextMonth?: boolean; | ||
title?: string; | ||
@@ -79,2 +81,6 @@ subTitle?: string; | ||
daysConfig?: Array<DayConfig>; | ||
/** | ||
* show last month & next month days fill six weeks | ||
*/ | ||
showAdjacentMonthDay?: boolean; | ||
} | ||
@@ -81,0 +87,0 @@ export interface CalendarComponentOptions extends CalendarOptions { |
@@ -29,2 +29,3 @@ "use strict"; | ||
this._d = this.calSvc.safeOpt(this.params.get('options')); | ||
this._d.showAdjacentMonthDay = false; | ||
this.step = this._d.step; | ||
@@ -31,0 +32,0 @@ if (this.step < 1) { |
@@ -145,3 +145,3 @@ "use strict"; | ||
providers: [exports.MONTH_VALUE_ACCESSOR], | ||
template: "\n <div [class]=\"color\">\n <ng-template [ngIf]=\"!_isRange\" [ngIfElse]=\"rangeBox\">\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #rangeBox>\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\"\n [class.startSelection]=\"isStartSelection(day)\"\n [class.endSelection]=\"isEndSelection(day)\"\n [class.between]=\"isBetween(day)\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n " | ||
template: "\n <div [class]=\"color\">\n <ng-template [ngIf]=\"!_isRange\" [ngIfElse]=\"rangeBox\">\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.last-month-day]=\"day.isLastMonth\"\n [class.next-month-day]=\"day.isNextMonth\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #rangeBox>\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\"\n [class.startSelection]=\"isStartSelection(day)\"\n [class.endSelection]=\"isEndSelection(day)\"\n [class.between]=\"isBetween(day)\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.last-month-day]=\"day.isLastMonth\"\n [class.next-month-day]=\"day.isNextMonth\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n " | ||
},] }, | ||
@@ -148,0 +148,0 @@ ]; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"MONTH_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"MonthComponent"},"multi":true},"MonthComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar-month","providers":[{"__symbolic":"reference","name":"MONTH_VALUE_ACCESSOR"}],"template":"\n <div [class]=\"color\">\n <ng-template [ngIf]=\"!_isRange\" [ngIfElse]=\"rangeBox\">\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #rangeBox>\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\"\n [class.startSelection]=\"isStartSelection(day)\"\n [class.endSelection]=\"isEndSelection(day)\"\n [class.between]=\"isBetween(day)\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n "}]}],"members":{"month":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pickMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isSaveHistory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"trackByTime":[{"__symbolic":"method"}],"isEndSelection":[{"__symbolic":"method"}],"isBetween":[{"__symbolic":"method"}],"isStartSelection":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"onSelected":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"MONTH_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"MonthComponent"},"multi":true},"MonthComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar-month","providers":[{"__symbolic":"reference","name":"MONTH_VALUE_ACCESSOR"}],"template":"\n <div [class]=\"color\">\n <ng-template [ngIf]=\"!_isRange\" [ngIfElse]=\"rangeBox\">\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #rangeBox>\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\"\n [class.startSelection]=\"isStartSelection(day)\"\n [class.endSelection]=\"isEndSelection(day)\"\n [class.between]=\"isBetween(day)\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n "}]}],"members":{"month":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pickMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isSaveHistory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"trackByTime":[{"__symbolic":"method"}],"isEndSelection":[{"__symbolic":"method"}],"isBetween":[{"__symbolic":"method"}],"isStartSelection":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"onSelected":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"MONTH_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"MonthComponent"},"multi":true},"MonthComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar-month","providers":[{"__symbolic":"reference","name":"MONTH_VALUE_ACCESSOR"}],"template":"\n <div [class]=\"color\">\n <ng-template [ngIf]=\"!_isRange\" [ngIfElse]=\"rangeBox\">\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.last-month-day]=\"day.isLastMonth\"\n [class.next-month-day]=\"day.isNextMonth\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #rangeBox>\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\"\n [class.startSelection]=\"isStartSelection(day)\"\n [class.endSelection]=\"isEndSelection(day)\"\n [class.between]=\"isBetween(day)\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.last-month-day]=\"day.isLastMonth\"\n [class.next-month-day]=\"day.isNextMonth\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n "}]}],"members":{"month":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pickMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isSaveHistory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"trackByTime":[{"__symbolic":"method"}],"isEndSelection":[{"__symbolic":"method"}],"isBetween":[{"__symbolic":"method"}],"isStartSelection":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"onSelected":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"MONTH_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"MonthComponent"},"multi":true},"MonthComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar-month","providers":[{"__symbolic":"reference","name":"MONTH_VALUE_ACCESSOR"}],"template":"\n <div [class]=\"color\">\n <ng-template [ngIf]=\"!_isRange\" [ngIfElse]=\"rangeBox\">\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.last-month-day]=\"day.isLastMonth\"\n [class.next-month-day]=\"day.isNextMonth\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #rangeBox>\n <div class=\"days-box\">\n <ng-template ngFor let-day [ngForOf]=\"month.days\" [ngForTrackBy]=\"trackByTime\">\n <div class=\"days\"\n [class.startSelection]=\"isStartSelection(day)\"\n [class.endSelection]=\"isEndSelection(day)\"\n [class.between]=\"isBetween(day)\">\n <ng-container *ngIf=\"day\">\n <button type='button'\n [class]=\"'days-btn ' + day.cssClass\"\n [class.today]=\"day.isToday\"\n (click)=\"onSelected(day)\"\n [class.marked]=\"day.marked\"\n [class.last-month-day]=\"day.isLastMonth\"\n [class.next-month-day]=\"day.isNextMonth\"\n [class.on-selected]=\"isSelected(day.time)\"\n [disabled]=\"day.disable\">\n <p>{{day.title}}</p>\n <small *ngIf=\"day.subTitle\">{{day?.subTitle}}</small>\n </button>\n </ng-container>\n\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n "}]}],"members":{"month":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"pickMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isSaveHistory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onSelectEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"trackByTime":[{"__symbolic":"method"}],"isEndSelection":[{"__symbolic":"method"}],"isBetween":[{"__symbolic":"method"}],"isStartSelection":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"onSelected":[{"__symbolic":"method"}]}}}}] |
@@ -7,3 +7,3 @@ import { CalendarOriginal, CalendarDay, CalendarMonth, CalendarModalOptions, CalendarResult } from '../calendar.model'; | ||
findDayConfig(day: any, opt: CalendarModalOptions): any; | ||
createCalendarDay(time: number, opt: CalendarModalOptions): CalendarDay; | ||
createCalendarDay(time: number, opt: CalendarModalOptions, month?: number): CalendarDay; | ||
createCalendarMonth(original: CalendarOriginal, opt: CalendarModalOptions): CalendarMonth; | ||
@@ -10,0 +10,0 @@ createMonthsByPeriod(startTime: number, monthsNum: number, opt: CalendarModalOptions): Array<CalendarMonth>; |
@@ -13,3 +13,3 @@ "use strict"; | ||
var _daysConfig = []; | ||
var _a = calendarOptions || {}, _b = _a.from, from = _b === void 0 ? new Date() : _b, _c = _a.to, to = _c === void 0 ? 0 : _c, _d = _a.weekStart, weekStart = _d === void 0 ? 0 : _d, _e = _a.step, step = _e === void 0 ? 3 : _e, _f = _a.id, id = _f === void 0 ? '' : _f, _g = _a.cssClass, cssClass = _g === void 0 ? '' : _g, _h = _a.closeLabel, closeLabel = _h === void 0 ? 'CANCEL' : _h, _j = _a.doneLabel, doneLabel = _j === void 0 ? 'DONE' : _j, _k = _a.monthFormat, monthFormat = _k === void 0 ? 'MMM YYYY' : _k, _l = _a.title, title = _l === void 0 ? 'CALENDAR' : _l, _m = _a.defaultTitle, defaultTitle = _m === void 0 ? '' : _m, _o = _a.defaultSubtitle, defaultSubtitle = _o === void 0 ? '' : _o, _p = _a.autoDone, autoDone = _p === void 0 ? false : _p, _q = _a.canBackwardsSelected, canBackwardsSelected = _q === void 0 ? false : _q, _r = _a.closeIcon, closeIcon = _r === void 0 ? false : _r, _s = _a.doneIcon, doneIcon = _s === void 0 ? false : _s, _t = _a.showYearPicker, showYearPicker = _t === void 0 ? false : _t, _u = _a.isSaveHistory, isSaveHistory = _u === void 0 ? false : _u, _v = _a.pickMode, pickMode = _v === void 0 ? config_1.pickModes.SINGLE : _v, _w = _a.color, color = _w === void 0 ? config_1.defaults.COLOR : _w, _x = _a.weekdays, weekdays = _x === void 0 ? config_1.defaults.WEEKS_FORMAT : _x, _y = _a.daysConfig, daysConfig = _y === void 0 ? _daysConfig : _y, _z = _a.disableWeeks, disableWeeks = _z === void 0 ? _disableWeeks : _z; | ||
var _a = calendarOptions || {}, _b = _a.from, from = _b === void 0 ? new Date() : _b, _c = _a.to, to = _c === void 0 ? 0 : _c, _d = _a.weekStart, weekStart = _d === void 0 ? 0 : _d, _e = _a.step, step = _e === void 0 ? 3 : _e, _f = _a.id, id = _f === void 0 ? '' : _f, _g = _a.cssClass, cssClass = _g === void 0 ? '' : _g, _h = _a.closeLabel, closeLabel = _h === void 0 ? 'CANCEL' : _h, _j = _a.doneLabel, doneLabel = _j === void 0 ? 'DONE' : _j, _k = _a.monthFormat, monthFormat = _k === void 0 ? 'MMM YYYY' : _k, _l = _a.title, title = _l === void 0 ? 'CALENDAR' : _l, _m = _a.defaultTitle, defaultTitle = _m === void 0 ? '' : _m, _o = _a.defaultSubtitle, defaultSubtitle = _o === void 0 ? '' : _o, _p = _a.autoDone, autoDone = _p === void 0 ? false : _p, _q = _a.canBackwardsSelected, canBackwardsSelected = _q === void 0 ? false : _q, _r = _a.closeIcon, closeIcon = _r === void 0 ? false : _r, _s = _a.doneIcon, doneIcon = _s === void 0 ? false : _s, _t = _a.showYearPicker, showYearPicker = _t === void 0 ? false : _t, _u = _a.isSaveHistory, isSaveHistory = _u === void 0 ? false : _u, _v = _a.pickMode, pickMode = _v === void 0 ? config_1.pickModes.SINGLE : _v, _w = _a.color, color = _w === void 0 ? config_1.defaults.COLOR : _w, _x = _a.weekdays, weekdays = _x === void 0 ? config_1.defaults.WEEKS_FORMAT : _x, _y = _a.daysConfig, daysConfig = _y === void 0 ? _daysConfig : _y, _z = _a.disableWeeks, disableWeeks = _z === void 0 ? _disableWeeks : _z, _0 = _a.showAdjacentMonthDay, showAdjacentMonthDay = _0 === void 0 ? true : _0; | ||
return { | ||
@@ -42,3 +42,4 @@ id: id, | ||
defaultDates: calendarOptions.defaultDates || null, | ||
defaultDateRange: calendarOptions.defaultDateRange || null | ||
defaultDateRange: calendarOptions.defaultDateRange || null, | ||
showAdjacentMonthDay: showAdjacentMonthDay | ||
}; | ||
@@ -66,4 +67,5 @@ }; | ||
}; | ||
CalendarService.prototype.createCalendarDay = function (time, opt) { | ||
CalendarService.prototype.createCalendarDay = function (time, opt, month) { | ||
var _time = moment(time); | ||
var date = moment(time); | ||
var isToday = moment().isSame(_time, 'days'); | ||
@@ -119,2 +121,4 @@ var dayConfig = this.findDayConfig(_time, opt); | ||
selected: false, | ||
isLastMonth: date.month() < month, | ||
isNextMonth: date.month() > month, | ||
marked: dayConfig ? dayConfig.marked || false : false, | ||
@@ -136,3 +140,2 @@ cssClass: dayConfig ? dayConfig.cssClass || '' : '', | ||
days.shift(); | ||
days.push(null); | ||
} | ||
@@ -143,2 +146,18 @@ else { | ||
} | ||
if (opt.showAdjacentMonthDay) { | ||
var _booleanMap = days.map(function (e) { return !!e; }); | ||
var thisMonth = moment(original.time).month(); | ||
var startOffsetIndex = _booleanMap.indexOf(true) - 1; | ||
var endOffsetIndex = _booleanMap.lastIndexOf(true) + 1; | ||
for (startOffsetIndex; startOffsetIndex >= 0; startOffsetIndex--) { | ||
var dayBefore = moment(days[startOffsetIndex + 1].time).clone().subtract(1, 'd'); | ||
days[startOffsetIndex] = this.createCalendarDay(dayBefore.valueOf(), opt, thisMonth); | ||
} | ||
if (!(_booleanMap.length % 7 === 0 && _booleanMap[_booleanMap.length - 1])) { | ||
for (endOffsetIndex; endOffsetIndex < days.length + (endOffsetIndex % 7); endOffsetIndex++) { | ||
var dayAfter = moment(days[endOffsetIndex - 1].time).clone().add(1, 'd'); | ||
days[endOffsetIndex] = this.createCalendarDay(dayAfter.valueOf(), opt, thisMonth); | ||
} | ||
} | ||
} | ||
return { | ||
@@ -145,0 +164,0 @@ days: days, |
{ | ||
"name": "ion2-calendar", | ||
"version": "2.1.6-beta.1", | ||
"version": "2.1.6-beta.2", | ||
"description": "A date picker component for ionic2 ", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
183313
1459