Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ion2-calendar

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ion2-calendar - npm Package Compare versions

Comparing version 2.1.5 to 2.1.6-beta.1

41

dist/components/calendar.component.d.ts
import { OnInit, EventEmitter, Provider } from '@angular/core';
import { CalendarMonth, CalendarModalOptions, CalendarComponentOptions, CalendarDay, CalendarComponentPayloadTypes, CalendarComponentMonthChange, CalendarComponentTypeProperty } from '../calendar.model';
import { CalendarComponentOptions, CalendarDay, CalendarComponentPayloadTypes, CalendarComponentMonthChange, CalendarComponentTypeProperty } from '../calendar.model';
import { CalendarService } from "../services/calendar.service";

@@ -8,9 +8,11 @@ import { ControlValueAccessor } from '@angular/forms';

calSvc: CalendarService;
_d: CalendarModalOptions;
_options: CalendarComponentOptions;
_view: 'month' | 'days';
_calendarMonthValue: CalendarDay[];
_showToggleButtons: boolean;
_showMonthPicker: boolean;
monthOpt: CalendarMonth;
private _d;
private _options;
private _view;
private _calendarMonthValue;
private _showToggleButtons;
showToggleButtons: boolean;
private _showMonthPicker;
showMonthPicker: boolean;
private monthOpt;
format: string;

@@ -25,11 +27,6 @@ type: CalendarComponentTypeProperty;

options: CalendarComponentOptions;
_onChanged: Function;
_onTouched: Function;
constructor(calSvc: CalendarService);
ngOnInit(): void;
initOpt(): void;
writeValue(obj: any): void;
registerOnChange(fn: () => {}): void;
registerOnTouched(fn: () => {}): void;
createMonth(date: number): CalendarMonth;
getViewDate(): CalendarComponentPayloadTypes;
setViewDate(value: CalendarComponentPayloadTypes): void;
switchView(): void;

@@ -47,6 +44,14 @@ prev(): void;

swipeEvent($event: any): void;
_writeValue(value: any): void;
_createCalendarDay(value: CalendarComponentPayloadTypes): CalendarDay;
_handleType(value: number): CalendarComponentPayloadTypes;
_onChanged: Function;
_onTouched: Function;
_payloadToTimeNumber(value: CalendarComponentPayloadTypes): number;
_monthFormat(date: number): string;
private initOpt();
private createMonth(date);
private _createCalendarDay(value);
private _handleType(value);
writeValue(obj: any): void;
registerOnChange(fn: () => {}): void;
registerOnTouched(fn: () => {}): void;
private _writeValue(value);
}

@@ -33,2 +33,22 @@ "use strict";

}
Object.defineProperty(CalendarComponent.prototype, "showToggleButtons", {
get: function () {
return this._showToggleButtons;
},
set: function (value) {
this._showToggleButtons = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CalendarComponent.prototype, "showMonthPicker", {
get: function () {
return this._showMonthPicker;
},
set: function (value) {
this._showMonthPicker = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CalendarComponent.prototype, "options", {

@@ -52,34 +72,8 @@ get: function () {

};
CalendarComponent.prototype.initOpt = function () {
if (this._options && typeof this._options.showToggleButtons === 'boolean') {
this._showToggleButtons = this._options.showToggleButtons;
}
if (this._options && typeof this._options.showMonthPicker === 'boolean') {
this._showMonthPicker = this._options.showMonthPicker;
if (this._view !== 'days' && !this._showMonthPicker) {
this._view = 'days';
}
}
this._d = this.calSvc.safeOpt(this._options || {});
CalendarComponent.prototype.getViewDate = function () {
return this._handleType(this.monthOpt.original.time);
};
CalendarComponent.prototype.writeValue = function (obj) {
if (obj) {
this._writeValue(obj);
if (this._calendarMonthValue[0]) {
this.monthOpt = this.createMonth(this._calendarMonthValue[0].time);
}
else {
this.monthOpt = this.createMonth(new Date().getTime());
}
}
CalendarComponent.prototype.setViewDate = function (value) {
this.monthOpt = this.createMonth(this._payloadToTimeNumber(value));
};
CalendarComponent.prototype.registerOnChange = function (fn) {
this._onChanged = fn;
};
CalendarComponent.prototype.registerOnTouched = function (fn) {
this._onTouched = fn;
};
CalendarComponent.prototype.createMonth = function (date) {
return this.calSvc.createMonthsByPeriod(date, 1, this._d)[0];
};
CalendarComponent.prototype.switchView = function () {

@@ -188,6 +182,72 @@ this._view = this._view === 'days' ? 'month' : 'days';

};
CalendarComponent.prototype._payloadToTimeNumber = function (value) {
var date;
if (this.type === 'string') {
date = moment(value, this.format);
}
else {
date = moment(value);
}
return date.valueOf();
};
CalendarComponent.prototype._monthFormat = function (date) {
return moment(date).format(this._d.monthFormat.replace(/y/g, 'Y'));
};
CalendarComponent.prototype.initOpt = function () {
if (this._options && typeof this._options.showToggleButtons === 'boolean') {
this.showToggleButtons = this._options.showToggleButtons;
}
if (this._options && typeof this._options.showMonthPicker === 'boolean') {
this.showMonthPicker = this._options.showMonthPicker;
if (this._view !== 'days' && !this.showMonthPicker) {
this._view = 'days';
}
}
this._d = this.calSvc.safeOpt(this._options || {});
};
CalendarComponent.prototype.createMonth = function (date) {
return this.calSvc.createMonthsByPeriod(date, 1, this._d)[0];
};
CalendarComponent.prototype._createCalendarDay = function (value) {
return this.calSvc.createCalendarDay(this._payloadToTimeNumber(value), this._d);
};
CalendarComponent.prototype._handleType = function (value) {
var date = moment(value);
switch (this.type) {
case 'string':
return date.format(this.format);
case 'js-date':
return date.toDate();
case 'moment':
return date;
case 'time':
return date.valueOf();
case 'object':
return date.toObject();
}
return date;
};
CalendarComponent.prototype.writeValue = function (obj) {
this._writeValue(obj);
if (obj) {
if (this._calendarMonthValue[0]) {
this.monthOpt = this.createMonth(this._calendarMonthValue[0].time);
}
else {
this.monthOpt = this.createMonth(new Date().getTime());
}
}
};
CalendarComponent.prototype.registerOnChange = function (fn) {
this._onChanged = fn;
};
CalendarComponent.prototype.registerOnTouched = function (fn) {
this._onTouched = fn;
};
CalendarComponent.prototype._writeValue = function (value) {
var _this = this;
if (!value)
if (!value) {
this._calendarMonthValue = [null, null];
return;
}
switch (this._d.pickMode) {

@@ -199,6 +259,6 @@ case 'single':

if (value.from) {
this._calendarMonthValue[0] = this._createCalendarDay(value.from);
this._calendarMonthValue[0] = value.from ? this._createCalendarDay(value.from) : null;
}
if (value.to) {
this._calendarMonthValue[1] = this._createCalendarDay(value.to);
this._calendarMonthValue[1] = value.to ? this._createCalendarDay(value.to) : null;
}

@@ -213,3 +273,3 @@ break;

else {
this._calendarMonthValue = [];
this._calendarMonthValue = [null, null];
}

@@ -220,31 +280,2 @@ break;

};
CalendarComponent.prototype._createCalendarDay = function (value) {
var date;
if (this.type === 'string') {
date = moment(value, this.format);
}
else {
date = moment(value);
}
return this.calSvc.createCalendarDay(date.valueOf(), this._d);
};
CalendarComponent.prototype._handleType = function (value) {
var date = moment(value);
switch (this.type) {
case 'string':
return date.format(this.format);
case 'js-date':
return date.toDate();
case 'moment':
return date;
case 'time':
return date.valueOf();
case 'object':
return date.toObject();
}
return date;
};
CalendarComponent.prototype._monthFormat = function (date) {
return moment(date).format(this._d.monthFormat.replace(/y/g, 'Y'));
};
CalendarComponent.decorators = [

@@ -251,0 +282,0 @@ { type: core_1.Component, args: [{

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"ION_CAL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"CalendarComponent"},"multi":true},"CalendarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar","providers":[{"__symbolic":"reference","name":"ION_CAL_VALUE_ACCESSOR"}],"template":"\n <div class=\"title\">\n <ng-template [ngIf]=\"_showMonthPicker\" [ngIfElse]=\"title\">\n <button type=\"button\"\n ion-button\n clear\n class=\"switch-btn\"\n (click)=\"switchView()\">\n {{_monthFormat(monthOpt.original.time)}}\n <ion-icon class=\"arrow-dropdown\"\n [name]=\"_view === 'days' ? 'md-arrow-dropdown' : 'md-arrow-dropup'\"></ion-icon>\n </button>\n </ng-template>\n <ng-template #title>\n <div class=\"switch-btn\">\n {{_monthFormat(monthOpt.original.time)}}\n </div>\n </ng-template>\n <ng-template [ngIf]=\"_showToggleButtons\">\n <button type='button' ion-button clear class=\"back\" [disabled]=\"!canBack()\" (click)=\"prev()\">\n <ion-icon name=\"ios-arrow-back\"></ion-icon>\n </button>\n <button type='button' ion-button clear class=\"forward\" [disabled]=\"!canNext()\" (click)=\"next()\">\n <ion-icon name=\"ios-arrow-forward\"></ion-icon>\n </button>\n </ng-template>\n </div>\n <ng-template [ngIf]=\"_view === 'days'\" [ngIfElse]=\"monthPicker\">\n <ion-calendar-week color=\"transparent\"\n [weekArray]=\"_d.weekdays\"\n [weekStart]=\"_d.weekStart\">\n </ion-calendar-week>\n\n <ion-calendar-month [(ngModel)]=\"_calendarMonthValue\"\n [month]=\"monthOpt\"\n [readonly]=\"readonly\"\n (onChange)=\"onChanged($event)\"\n (swipe)=\"swipeEvent($event)\"\n (onSelect)=\"onSelect.emit($event)\"\n (onSelectStart)=\"onSelectStart.emit($event)\"\n (onSelectEnd)=\"onSelectEnd.emit($event)\"\n [pickMode]=\"_d.pickMode\"\n [color]=\"_d.color\">\n </ion-calendar-month>\n </ng-template>\n\n <ng-template #monthPicker>\n <ion-calendar-month-picker [color]=\"_d.color\"\n [monthFormat]=\"_options?.monthPickerFormat\"\n (onSelect)=\"monthOnSelect($event)\"\n [month]=\"monthOpt\">\n </ion-calendar-month-picker>\n </ng-template>\n "}]}],"members":{"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__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"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"monthChange":[{"__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"}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../services/calendar.service","name":"CalendarService"}]}],"ngOnInit":[{"__symbolic":"method"}],"initOpt":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"createMonth":[{"__symbolic":"method"}],"switchView":[{"__symbolic":"method"}],"prev":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"prevYear":[{"__symbolic":"method"}],"nextYear":[{"__symbolic":"method"}],"nextMonth":[{"__symbolic":"method"}],"canNext":[{"__symbolic":"method"}],"backMonth":[{"__symbolic":"method"}],"canBack":[{"__symbolic":"method"}],"monthOnSelect":[{"__symbolic":"method"}],"onChanged":[{"__symbolic":"method"}],"swipeEvent":[{"__symbolic":"method"}],"_writeValue":[{"__symbolic":"method"}],"_createCalendarDay":[{"__symbolic":"method"}],"_handleType":[{"__symbolic":"method"}],"_monthFormat":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"ION_CAL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"CalendarComponent"},"multi":true},"CalendarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar","providers":[{"__symbolic":"reference","name":"ION_CAL_VALUE_ACCESSOR"}],"template":"\n <div class=\"title\">\n <ng-template [ngIf]=\"_showMonthPicker\" [ngIfElse]=\"title\">\n <button type=\"button\"\n ion-button\n clear\n class=\"switch-btn\"\n (click)=\"switchView()\">\n {{_monthFormat(monthOpt.original.time)}}\n <ion-icon class=\"arrow-dropdown\"\n [name]=\"_view === 'days' ? 'md-arrow-dropdown' : 'md-arrow-dropup'\"></ion-icon>\n </button>\n </ng-template>\n <ng-template #title>\n <div class=\"switch-btn\">\n {{_monthFormat(monthOpt.original.time)}}\n </div>\n </ng-template>\n <ng-template [ngIf]=\"_showToggleButtons\">\n <button type='button' ion-button clear class=\"back\" [disabled]=\"!canBack()\" (click)=\"prev()\">\n <ion-icon name=\"ios-arrow-back\"></ion-icon>\n </button>\n <button type='button' ion-button clear class=\"forward\" [disabled]=\"!canNext()\" (click)=\"next()\">\n <ion-icon name=\"ios-arrow-forward\"></ion-icon>\n </button>\n </ng-template>\n </div>\n <ng-template [ngIf]=\"_view === 'days'\" [ngIfElse]=\"monthPicker\">\n <ion-calendar-week color=\"transparent\"\n [weekArray]=\"_d.weekdays\"\n [weekStart]=\"_d.weekStart\">\n </ion-calendar-week>\n\n <ion-calendar-month [(ngModel)]=\"_calendarMonthValue\"\n [month]=\"monthOpt\"\n [readonly]=\"readonly\"\n (onChange)=\"onChanged($event)\"\n (swipe)=\"swipeEvent($event)\"\n (onSelect)=\"onSelect.emit($event)\"\n (onSelectStart)=\"onSelectStart.emit($event)\"\n (onSelectEnd)=\"onSelectEnd.emit($event)\"\n [pickMode]=\"_d.pickMode\"\n [color]=\"_d.color\">\n </ion-calendar-month>\n </ng-template>\n\n <ng-template #monthPicker>\n <ion-calendar-month-picker [color]=\"_d.color\"\n [monthFormat]=\"_options?.monthPickerFormat\"\n (onSelect)=\"monthOnSelect($event)\"\n [month]=\"monthOpt\">\n </ion-calendar-month-picker>\n </ng-template>\n "}]}],"members":{"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__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"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"monthChange":[{"__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"}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../services/calendar.service","name":"CalendarService"}]}],"ngOnInit":[{"__symbolic":"method"}],"initOpt":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"createMonth":[{"__symbolic":"method"}],"switchView":[{"__symbolic":"method"}],"prev":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"prevYear":[{"__symbolic":"method"}],"nextYear":[{"__symbolic":"method"}],"nextMonth":[{"__symbolic":"method"}],"canNext":[{"__symbolic":"method"}],"backMonth":[{"__symbolic":"method"}],"canBack":[{"__symbolic":"method"}],"monthOnSelect":[{"__symbolic":"method"}],"onChanged":[{"__symbolic":"method"}],"swipeEvent":[{"__symbolic":"method"}],"_writeValue":[{"__symbolic":"method"}],"_createCalendarDay":[{"__symbolic":"method"}],"_handleType":[{"__symbolic":"method"}],"_monthFormat":[{"__symbolic":"method"}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"ION_CAL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"CalendarComponent"},"multi":true},"CalendarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar","providers":[{"__symbolic":"reference","name":"ION_CAL_VALUE_ACCESSOR"}],"template":"\n <div class=\"title\">\n <ng-template [ngIf]=\"_showMonthPicker\" [ngIfElse]=\"title\">\n <button type=\"button\"\n ion-button\n clear\n class=\"switch-btn\"\n (click)=\"switchView()\">\n {{_monthFormat(monthOpt.original.time)}}\n <ion-icon class=\"arrow-dropdown\"\n [name]=\"_view === 'days' ? 'md-arrow-dropdown' : 'md-arrow-dropup'\"></ion-icon>\n </button>\n </ng-template>\n <ng-template #title>\n <div class=\"switch-btn\">\n {{_monthFormat(monthOpt.original.time)}}\n </div>\n </ng-template>\n <ng-template [ngIf]=\"_showToggleButtons\">\n <button type='button' ion-button clear class=\"back\" [disabled]=\"!canBack()\" (click)=\"prev()\">\n <ion-icon name=\"ios-arrow-back\"></ion-icon>\n </button>\n <button type='button' ion-button clear class=\"forward\" [disabled]=\"!canNext()\" (click)=\"next()\">\n <ion-icon name=\"ios-arrow-forward\"></ion-icon>\n </button>\n </ng-template>\n </div>\n <ng-template [ngIf]=\"_view === 'days'\" [ngIfElse]=\"monthPicker\">\n <ion-calendar-week color=\"transparent\"\n [weekArray]=\"_d.weekdays\"\n [weekStart]=\"_d.weekStart\">\n </ion-calendar-week>\n\n <ion-calendar-month [(ngModel)]=\"_calendarMonthValue\"\n [month]=\"monthOpt\"\n [readonly]=\"readonly\"\n (onChange)=\"onChanged($event)\"\n (swipe)=\"swipeEvent($event)\"\n (onSelect)=\"onSelect.emit($event)\"\n (onSelectStart)=\"onSelectStart.emit($event)\"\n (onSelectEnd)=\"onSelectEnd.emit($event)\"\n [pickMode]=\"_d.pickMode\"\n [color]=\"_d.color\">\n </ion-calendar-month>\n </ng-template>\n\n <ng-template #monthPicker>\n <ion-calendar-month-picker [color]=\"_d.color\"\n [monthFormat]=\"_options?.monthPickerFormat\"\n (onSelect)=\"monthOnSelect($event)\"\n [month]=\"monthOpt\">\n </ion-calendar-month-picker>\n </ng-template>\n "}]}],"members":{"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__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"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"monthChange":[{"__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"}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../services/calendar.service","name":"CalendarService"}]}],"ngOnInit":[{"__symbolic":"method"}],"getViewDate":[{"__symbolic":"method"}],"setViewDate":[{"__symbolic":"method"}],"switchView":[{"__symbolic":"method"}],"prev":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"prevYear":[{"__symbolic":"method"}],"nextYear":[{"__symbolic":"method"}],"nextMonth":[{"__symbolic":"method"}],"canNext":[{"__symbolic":"method"}],"backMonth":[{"__symbolic":"method"}],"canBack":[{"__symbolic":"method"}],"monthOnSelect":[{"__symbolic":"method"}],"onChanged":[{"__symbolic":"method"}],"swipeEvent":[{"__symbolic":"method"}],"_payloadToTimeNumber":[{"__symbolic":"method"}],"_monthFormat":[{"__symbolic":"method"}],"initOpt":[{"__symbolic":"method"}],"createMonth":[{"__symbolic":"method"}],"_createCalendarDay":[{"__symbolic":"method"}],"_handleType":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"_writeValue":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"ION_CAL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"CalendarComponent"},"multi":true},"CalendarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ion-calendar","providers":[{"__symbolic":"reference","name":"ION_CAL_VALUE_ACCESSOR"}],"template":"\n <div class=\"title\">\n <ng-template [ngIf]=\"_showMonthPicker\" [ngIfElse]=\"title\">\n <button type=\"button\"\n ion-button\n clear\n class=\"switch-btn\"\n (click)=\"switchView()\">\n {{_monthFormat(monthOpt.original.time)}}\n <ion-icon class=\"arrow-dropdown\"\n [name]=\"_view === 'days' ? 'md-arrow-dropdown' : 'md-arrow-dropup'\"></ion-icon>\n </button>\n </ng-template>\n <ng-template #title>\n <div class=\"switch-btn\">\n {{_monthFormat(monthOpt.original.time)}}\n </div>\n </ng-template>\n <ng-template [ngIf]=\"_showToggleButtons\">\n <button type='button' ion-button clear class=\"back\" [disabled]=\"!canBack()\" (click)=\"prev()\">\n <ion-icon name=\"ios-arrow-back\"></ion-icon>\n </button>\n <button type='button' ion-button clear class=\"forward\" [disabled]=\"!canNext()\" (click)=\"next()\">\n <ion-icon name=\"ios-arrow-forward\"></ion-icon>\n </button>\n </ng-template>\n </div>\n <ng-template [ngIf]=\"_view === 'days'\" [ngIfElse]=\"monthPicker\">\n <ion-calendar-week color=\"transparent\"\n [weekArray]=\"_d.weekdays\"\n [weekStart]=\"_d.weekStart\">\n </ion-calendar-week>\n\n <ion-calendar-month [(ngModel)]=\"_calendarMonthValue\"\n [month]=\"monthOpt\"\n [readonly]=\"readonly\"\n (onChange)=\"onChanged($event)\"\n (swipe)=\"swipeEvent($event)\"\n (onSelect)=\"onSelect.emit($event)\"\n (onSelectStart)=\"onSelectStart.emit($event)\"\n (onSelectEnd)=\"onSelectEnd.emit($event)\"\n [pickMode]=\"_d.pickMode\"\n [color]=\"_d.color\">\n </ion-calendar-month>\n </ng-template>\n\n <ng-template #monthPicker>\n <ion-calendar-month-picker [color]=\"_d.color\"\n [monthFormat]=\"_options?.monthPickerFormat\"\n (onSelect)=\"monthOnSelect($event)\"\n [month]=\"monthOpt\">\n </ion-calendar-month-picker>\n </ng-template>\n "}]}],"members":{"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"type":[{"__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"}}]}],"onChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"monthChange":[{"__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"}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../services/calendar.service","name":"CalendarService"}]}],"ngOnInit":[{"__symbolic":"method"}],"getViewDate":[{"__symbolic":"method"}],"setViewDate":[{"__symbolic":"method"}],"switchView":[{"__symbolic":"method"}],"prev":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"prevYear":[{"__symbolic":"method"}],"nextYear":[{"__symbolic":"method"}],"nextMonth":[{"__symbolic":"method"}],"canNext":[{"__symbolic":"method"}],"backMonth":[{"__symbolic":"method"}],"canBack":[{"__symbolic":"method"}],"monthOnSelect":[{"__symbolic":"method"}],"onChanged":[{"__symbolic":"method"}],"swipeEvent":[{"__symbolic":"method"}],"_payloadToTimeNumber":[{"__symbolic":"method"}],"_monthFormat":[{"__symbolic":"method"}],"initOpt":[{"__symbolic":"method"}],"createMonth":[{"__symbolic":"method"}],"_createCalendarDay":[{"__symbolic":"method"}],"_handleType":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"_writeValue":[{"__symbolic":"method"}]}}}}]

@@ -34,2 +34,3 @@ "use strict";

MonthComponent.prototype.writeValue = function (obj) {
console.log(obj);
if (Array.isArray(obj)) {

@@ -36,0 +37,0 @@ this._date = obj;

{
"name": "ion2-calendar",
"version": "2.1.5",
"version": "2.1.6-beta.1",
"description": "A date picker component for ionic2 ",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -161,2 +161,5 @@ # 📅 ion2-calendar

| monthChange | EventEmitter | 月份被改变 |
| onSelect | EventEmitter | 点击天按钮 |
| onSelectStart | EventEmitter | 点击天按钮 |
| onSelectEnd | EventEmitter | 点击天按钮 |

@@ -163,0 +166,0 @@ ### CalendarComponentOptions

@@ -163,3 +163,6 @@ # 📅 ion2-calendar

| onChange | EventEmitter| event for model change |
| monthChange | EventEmitter | event for month change |
| monthChange | EventEmitter | event for month change |
| onSelect | EventEmitter | event for click day-button |
| onSelectStart | EventEmitter | event for click day-button |
| onSelectEnd | EventEmitter | event for click day-button |

@@ -166,0 +169,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc