@syncfusion/ej2-calendars
Advanced tools
Comparing version 16.4.40-beta to 16.4.42
@@ -5,4 +5,24 @@ # Changelog | ||
### Calendar | ||
#### New Features | ||
- Added the Islamic calendar support. | ||
### DatePicker | ||
#### New Features | ||
- Added the Islamic DatePicker support. | ||
### DateTimePicker | ||
#### New Features | ||
- Added the Islamic DateTimePicker support. | ||
## 16.4.40-beta (2018-12-10) | ||
### DatePicker | ||
#### Bug Fixes | ||
@@ -9,0 +29,0 @@ |
/*! | ||
* filename: index.d.ts | ||
* version : 16.4.40-beta | ||
* version : 16.4.42 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"name": "@syncfusion/ej2-calendars", | ||
"version": "16.4.40-beta", | ||
"version": "16.4.42", | ||
"description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.", | ||
@@ -11,7 +11,7 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~16.4.40-beta", | ||
"@syncfusion/ej2-popups": "~16.4.40-beta", | ||
"@syncfusion/ej2-inputs": "~16.4.40-beta", | ||
"@syncfusion/ej2-lists": "~16.4.40-beta", | ||
"@syncfusion/ej2-buttons": "~16.4.40-beta" | ||
"@syncfusion/ej2-base": "~16.4.42", | ||
"@syncfusion/ej2-popups": "~16.4.42", | ||
"@syncfusion/ej2-inputs": "~16.4.42", | ||
"@syncfusion/ej2-lists": "~16.4.42", | ||
"@syncfusion/ej2-buttons": "~16.4.42" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
@@ -1,3 +0,3 @@ | ||
import { Component, EventHandler, Internationalization, } from '@syncfusion/ej2-base';import { INotifyPropertyChanged, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, KeyboardEventArgs, BaseEventArgs } from '@syncfusion/ej2-base';import { cldrData, getDefaultDateObject, rippleEffect } from '@syncfusion/ej2-base';import { createElement, removeClass, detach, closest, addClass, attributes } from '@syncfusion/ej2-base';import { getValue, getUniqueID, extend, Browser } from '@syncfusion/ej2-base';import { Property, Event, EmitType, isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
import {CalendarView,NavigatedEventArgs,RenderDayCellEventArgs,ChangedEventArgs} from "./calendar"; | ||
import { Component, EventHandler, Internationalization, ModuleDeclaration } from '@syncfusion/ej2-base';import { INotifyPropertyChanged, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, KeyboardEventArgs, BaseEventArgs } from '@syncfusion/ej2-base';import { cldrData, getDefaultDateObject, rippleEffect } from '@syncfusion/ej2-base';import { createElement, removeClass, detach, closest, addClass, attributes } from '@syncfusion/ej2-base';import { getValue, getUniqueID, extend, Browser } from '@syncfusion/ej2-base';import { Property, Event, EmitType, isNullOrUndefined, throwError } from '@syncfusion/ej2-base';import { Islamic, IslamicDateArgs } from './index'; | ||
import {CalendarType,CalendarView,NavigatedEventArgs,RenderDayCellEventArgs,ChangedEventArgs} from "./calendar"; | ||
import {ComponentModel} from '@syncfusion/ej2-base'; | ||
@@ -33,2 +33,8 @@ | ||
/** | ||
* Gets or sets the Calendar's Type like gregorian or islamic. | ||
* @default Gregorian | ||
*/ | ||
calendarMode?: CalendarType; | ||
/** | ||
* Specifies the initial view of the Calendar when it is opened. | ||
@@ -35,0 +41,0 @@ * With the help of this property, initial view can be changed to year or decade view. |
@@ -1,2 +0,2 @@ | ||
import { Component, Internationalization } from '@syncfusion/ej2-base'; | ||
import { Component, Internationalization, ModuleDeclaration } from '@syncfusion/ej2-base'; | ||
import { INotifyPropertyChanged, KeyboardEvents, L10n } from '@syncfusion/ej2-base'; | ||
@@ -6,2 +6,3 @@ import { KeyboardEventArgs, BaseEventArgs } from '@syncfusion/ej2-base'; | ||
import { CalendarModel, CalendarBaseModel } from './calendar-model'; | ||
import { Islamic } from './index'; | ||
/** | ||
@@ -11,2 +12,3 @@ * Specifies the view of the calendar. | ||
export declare type CalendarView = 'Month' | 'Year' | 'Decade'; | ||
export declare type CalendarType = 'Islamic' | 'Gregorian'; | ||
/** | ||
@@ -29,2 +31,3 @@ * | ||
protected globalize: Internationalization; | ||
islamicModule: Islamic; | ||
protected currentDate: Date; | ||
@@ -65,2 +68,7 @@ protected navigatedArgs: NavigatedEventArgs; | ||
/** | ||
* Gets or sets the Calendar's Type like gregorian or islamic. | ||
* @default Gregorian | ||
*/ | ||
calendarMode: CalendarType; | ||
/** | ||
* Specifies the initial view of the Calendar when it is opened. | ||
@@ -217,2 +225,3 @@ * With the help of this property, initial view can be changed to year or decade view. | ||
protected getModuleName(): string; | ||
requiredModules(): ModuleDeclaration[]; | ||
/** | ||
@@ -443,1 +452,6 @@ * Gets the properties to be maintained upon browser refresh. | ||
} | ||
export interface IslamicObject { | ||
year: number; | ||
date: number; | ||
month: number; | ||
} |
@@ -5,2 +5,3 @@ /** | ||
export * from './calendar'; | ||
export * from './islamic'; | ||
export * from './calendar-model'; |
@@ -5,1 +5,2 @@ /** | ||
export * from './calendar'; | ||
export * from './islamic'; |
@@ -1,2 +0,2 @@ | ||
import { EventHandler, Property, Internationalization, NotifyPropertyChanges } from '@syncfusion/ej2-base';import { KeyboardEvents, KeyboardEventArgs, Animation, EmitType, Event, L10n, Browser, formatUnit } from '@syncfusion/ej2-base';import { createElement, detach, addClass, removeClass, closest, classList, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined, setValue, getUniqueID } from '@syncfusion/ej2-base';import { Popup } from '@syncfusion/ej2-popups';import { Input, InputObject, IInput, FloatLabelType, BlurEventArgs, FocusEventArgs } from '@syncfusion/ej2-inputs';import { ChangedEventArgs, CalendarView, Calendar } from '../calendar/calendar'; | ||
import { EventHandler, Property, Internationalization, NotifyPropertyChanges, DateFormatOptions } from '@syncfusion/ej2-base';import { KeyboardEvents, KeyboardEventArgs, Animation, EmitType, Event, L10n, Browser, formatUnit } from '@syncfusion/ej2-base';import { createElement, detach, addClass, removeClass, closest, classList, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined, setValue, getUniqueID, ModuleDeclaration } from '@syncfusion/ej2-base';import { Popup } from '@syncfusion/ej2-popups';import { Input, InputObject, IInput, FloatLabelType, BlurEventArgs, FocusEventArgs } from '@syncfusion/ej2-inputs';import { ChangedEventArgs, CalendarView, Calendar } from '../calendar/calendar'; | ||
import {PopupObjectArgs,PreventableEventArgs} from "./datepicker"; | ||
@@ -46,2 +46,9 @@ import {CalendarModel} from "../calendar/calendar-model"; | ||
/** | ||
* Gets or sets multiple selected dates of the calendar. | ||
* @default null | ||
* @private | ||
*/ | ||
values?: Date[]; | ||
/** | ||
* Specifies the option to enable the multiple dates selection of the calendar. | ||
@@ -48,0 +55,0 @@ * @default false |
/// <reference path="../calendar/calendar-model.d.ts" /> | ||
import { KeyboardEventArgs, EmitType, L10n } from '@syncfusion/ej2-base'; | ||
import { ModuleDeclaration } from '@syncfusion/ej2-base'; | ||
import { Popup } from '@syncfusion/ej2-popups'; | ||
@@ -182,3 +183,3 @@ import { InputObject, IInput, FloatLabelType, BlurEventArgs, FocusEventArgs } from '@syncfusion/ej2-inputs'; | ||
protected bindEvents(): void; | ||
protected resetFormHandler(e: MouseEvent): void; | ||
protected resetFormHandler(): void; | ||
private inputChangeHandler; | ||
@@ -200,2 +201,3 @@ private bindClearEvent; | ||
protected changeEvent(event?: MouseEvent | KeyboardEvent | Event): void; | ||
requiredModules(): ModuleDeclaration[]; | ||
protected selectCalendar(e?: MouseEvent | KeyboardEvent | Event): void; | ||
@@ -202,0 +204,0 @@ protected isCalendar(): boolean; |
@@ -168,23 +168,7 @@ var __extends = (this && this.__extends) || (function () { | ||
DatePicker.prototype.updateInput = function () { | ||
var formatOptions; | ||
if (this.value && !this.isCalendar()) { | ||
this.disabledDates(); | ||
} | ||
if (+new Date('' + this.value)) { // persis the value property. | ||
if (typeof this.value === 'string') { | ||
this.value = this.checkDateValue(new Date('' + this.value)); | ||
var dateOptions = void 0; | ||
if (this.getModuleName() === 'datetimepicker') { | ||
dateOptions = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}; | ||
} | ||
else { | ||
dateOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
var dateString = this.globalize.formatDate(this.value, dateOptions); | ||
this.setProperties({ value: this.globalize.parseDate(dateString, dateOptions) }, true); | ||
} | ||
} | ||
else { | ||
if (!+new Date('' + this.value)) { | ||
this.setProperties({ value: null }, true); | ||
@@ -203,6 +187,21 @@ } | ||
if (this.getModuleName() === 'datetimepicker') { | ||
dateString = this.globalize.formatDate(this.value, { format: tempFormat, type: 'dateTime', skeleton: 'yMd' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
dateString = this.globalize.formatDate(this.value, { | ||
format: tempFormat, type: 'dateTime', skeleton: 'yMd' | ||
}); | ||
} | ||
else { | ||
dateString = this.globalize.formatDate(this.value, { | ||
format: tempFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' | ||
}); | ||
} | ||
} | ||
else { | ||
dateString = this.globalize.formatDate(this.value, { format: this.format, type: 'dateTime', skeleton: 'yMd' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
formatOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
formatOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
dateString = this.globalize.formatDate(this.value, formatOptions); | ||
} | ||
@@ -270,3 +269,3 @@ if ((+dateValue <= +this.max) && (+dateValue >= +this.min)) { | ||
}; | ||
DatePicker.prototype.resetFormHandler = function (e) { | ||
DatePicker.prototype.resetFormHandler = function () { | ||
if (this.inputElement.getAttribute('value')) { | ||
@@ -276,9 +275,7 @@ this.value = this.checkDateValue(new Date('' + this.element.getAttribute('value'))); | ||
else { | ||
if (this.formElement && e.target === this.formElement) { | ||
this.value = null; | ||
if (this.inputElement) { | ||
Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton); | ||
attributes(this.inputElement, { 'aria-invalid': 'false' }); | ||
removeClass([this.inputWrapper.container], ERROR); | ||
} | ||
this.value = null; | ||
if (this.inputElement) { | ||
Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton); | ||
attributes(this.inputElement, { 'aria-invalid': 'false' }); | ||
removeClass([this.inputWrapper.container], ERROR); | ||
} | ||
@@ -420,4 +417,4 @@ } | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
} | ||
e.stopPropagation(); | ||
break; | ||
@@ -440,2 +437,3 @@ case 'tab': | ||
var format; | ||
var formatOptions; | ||
if (this.getModuleName() === 'datetimepicker') { | ||
@@ -455,9 +453,23 @@ format = !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat; | ||
if (this.getModuleName() === 'datetimepicker') { | ||
dateOptions = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}; | ||
if (this.calendarMode === 'Gregorian') { | ||
dateOptions = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}; | ||
} | ||
else { | ||
dateOptions = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' | ||
}; | ||
} | ||
} | ||
else { | ||
dateOptions = { format: format, type: 'dateTime', skeleton: 'yMd' }; | ||
if (this.calendarMode === 'Gregorian') { | ||
formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
dateOptions = formatOptions; | ||
} | ||
@@ -470,3 +482,9 @@ var date; | ||
else { | ||
date = this.globalize.parseDate(this.inputElement.value, { type: 'dateTime', skeleton: 'yMd' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
formatOptions = { type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
formatOptions = { type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
date = this.globalize.parseDate(this.inputElement.value, formatOptions); | ||
} | ||
@@ -558,2 +576,3 @@ } | ||
DatePicker.prototype.modelHeader = function () { | ||
var dateOptions; | ||
var modelHeader = this.createElement('div', { className: 'e-model-header' }); | ||
@@ -564,5 +583,23 @@ var yearHeading = this.createElement('h1', { className: 'e-model-year' }); | ||
var monthSpan = this.createElement('span', { className: 'e-model-month' }); | ||
yearHeading.textContent = '' + this.globalize.formatDate(this.value || new Date(), { format: 'y', skeleton: 'dateTime' }); | ||
daySpan.textContent = '' + this.globalize.formatDate(this.value || new Date(), { format: 'E', skeleton: 'dateTime' }) + ', '; | ||
monthSpan.textContent = '' + this.globalize.formatDate(this.value || new Date(), { format: 'MMM d', skeleton: 'dateTime' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
dateOptions = { format: 'y', skeleton: 'dateTime' }; | ||
} | ||
else { | ||
dateOptions = { format: 'y', skeleton: 'dateTime', calendar: 'islamic' }; | ||
} | ||
yearHeading.textContent = '' + this.globalize.formatDate(this.value || new Date(), dateOptions); | ||
if (this.calendarMode === 'Gregorian') { | ||
dateOptions = { format: 'E', skeleton: 'dateTime' }; | ||
} | ||
else { | ||
dateOptions = { format: 'E', skeleton: 'dateTime', calendar: 'islamic' }; | ||
} | ||
daySpan.textContent = '' + this.globalize.formatDate(this.value || new Date(), dateOptions) + ', '; | ||
if (this.calendarMode === 'Gregorian') { | ||
dateOptions = { format: 'MMM d', skeleton: 'dateTime' }; | ||
} | ||
else { | ||
dateOptions = { format: 'MMM d', skeleton: 'dateTime', calendar: 'islamic' }; | ||
} | ||
monthSpan.textContent = '' + this.globalize.formatDate(this.value || new Date(), dateOptions); | ||
modelHeader.appendChild(yearHeading); | ||
@@ -603,5 +640,13 @@ h2.appendChild(daySpan); | ||
}; | ||
DatePicker.prototype.requiredModules = function () { | ||
var modules = []; | ||
if (this) { | ||
modules.push({ args: [this], member: 'islamic' }); | ||
} | ||
return modules; | ||
}; | ||
DatePicker.prototype.selectCalendar = function (e) { | ||
var date; | ||
var tempFormat; | ||
var formatOptions; | ||
if (this.getModuleName() === 'datetimepicker') { | ||
@@ -615,6 +660,18 @@ tempFormat = !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat; | ||
if (this.getModuleName() === 'datetimepicker') { | ||
date = this.globalize.formatDate(this.changedArgs.value, { format: tempFormat, type: 'dateTime', skeleton: 'yMd' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
date = this.globalize.formatDate(this.changedArgs.value, formatOptions); | ||
} | ||
else { | ||
date = this.globalize.formatDate(this.changedArgs.value, { format: this.format, type: 'dateTime', skeleton: 'yMd' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
formatOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
formatOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
date = this.globalize.formatDate(this.changedArgs.value, formatOptions); | ||
} | ||
@@ -906,9 +963,22 @@ } | ||
if (this.getModuleName() === 'datetimepicker') { | ||
options = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}; | ||
if (this.calendarMode === 'Gregorian') { | ||
options = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}; | ||
} | ||
else { | ||
options = { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' | ||
}; | ||
} | ||
} | ||
else { | ||
options = { format: this.format, type: 'dateTime', skeleton: 'yMd' }; | ||
if (this.calendarMode === 'Gregorian') { | ||
options = { format: this.format, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
options = { format: this.format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
} | ||
@@ -975,2 +1045,4 @@ for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) { | ||
var valueCopy; | ||
var formatOptions; | ||
var globalize; | ||
valueCopy = this.checkDateValue(this.value) ? new Date(+this.value) : new Date('' + this.value); | ||
@@ -998,9 +1070,24 @@ var previousValCopy = this.previousDate; | ||
if (this.getModuleName() === 'datetimepicker') { | ||
inputVal = this.globalize.formatDate(valueCopy, { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}); | ||
if (this.calendarMode === 'Gregorian') { | ||
globalize = this.globalize.formatDate(valueCopy, { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd' | ||
}); | ||
} | ||
else { | ||
globalize = this.globalize.formatDate(valueCopy, { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.dateTimeFormat, | ||
type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' | ||
}); | ||
} | ||
inputVal = globalize; | ||
} | ||
else { | ||
inputVal = this.globalize.formatDate(valueCopy, { format: this.format, type: 'dateTime', skeleton: 'yMd' }); | ||
if (this.calendarMode === 'Gregorian') { | ||
formatOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
formatOptions = { format: this.format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
inputVal = this.globalize.formatDate(valueCopy, formatOptions); | ||
} | ||
@@ -1141,2 +1228,5 @@ Input.setValue(inputVal, this.inputElement, this.floatLabelType, this.showClearButton); | ||
__decorate([ | ||
Property(null) | ||
], DatePicker.prototype, "values", void 0); | ||
__decorate([ | ||
Property(false) | ||
@@ -1143,0 +1233,0 @@ ], DatePicker.prototype, "isMultiSelection", void 0); |
@@ -1,2 +0,2 @@ | ||
import { Property, EventHandler, Internationalization, NotifyPropertyChanges, detach, getUniqueID } from '@syncfusion/ej2-base';import { KeyboardEvents, BaseEventArgs, KeyboardEventArgs, Event, EmitType, Browser, L10n, ChildProperty } from '@syncfusion/ej2-base';import { addClass, createElement, remove, closest, select, prepend, removeClass, attributes, Collection } from '@syncfusion/ej2-base';import { isNullOrUndefined, isUndefined, formatUnit, setValue, rippleEffect, merge, extend } from '@syncfusion/ej2-base';import { CalendarView, CalendarBase, NavigatedEventArgs, RenderDayCellEventArgs } from '../calendar/calendar';import { Popup } from '@syncfusion/ej2-popups';import { Button } from '@syncfusion/ej2-buttons';import { Input, InputObject, FloatLabelType, FocusEventArgs, BlurEventArgs } from '@syncfusion/ej2-inputs';import { ListBase, cssClass as ListBaseClasses } from '@syncfusion/ej2-lists'; | ||
import { Property, EventHandler, Internationalization, NotifyPropertyChanges, detach, getUniqueID } from '@syncfusion/ej2-base';import { KeyboardEvents, BaseEventArgs, KeyboardEventArgs, Event, EmitType, Browser, L10n, ChildProperty } from '@syncfusion/ej2-base';import { addClass, createElement, remove, closest, select, prepend, removeClass, attributes, Collection } from '@syncfusion/ej2-base';import { isNullOrUndefined, isUndefined, formatUnit, setValue, rippleEffect, merge, extend } from '@syncfusion/ej2-base';import { CalendarView, CalendarBase, NavigatedEventArgs, RenderDayCellEventArgs, CalendarType } from '../calendar/calendar';import { Popup } from '@syncfusion/ej2-popups';import { Button } from '@syncfusion/ej2-buttons';import { Input, InputObject, FloatLabelType, FocusEventArgs, BlurEventArgs } from '@syncfusion/ej2-inputs';import { ListBase, cssClass as ListBaseClasses } from '@syncfusion/ej2-lists'; | ||
import {DateRange,RangeEventArgs} from "./daterangepicker"; | ||
@@ -89,2 +89,9 @@ import {CalendarBaseModel} from "../calendar/calendar-model"; | ||
/** | ||
* Gets or sets the Calendar's Type like gregorian or islamic. | ||
* @default Gregorian | ||
* @private | ||
*/ | ||
calendarMode?: CalendarType; | ||
/** | ||
* Triggers when Calendar is created. | ||
@@ -91,0 +98,0 @@ * @event |
/// <reference path="../calendar/calendar-model.d.ts" /> | ||
import { KeyboardEvents, BaseEventArgs, KeyboardEventArgs, EmitType, ChildProperty } from '@syncfusion/ej2-base'; | ||
import { CalendarView, CalendarBase, NavigatedEventArgs, RenderDayCellEventArgs } from '../calendar/calendar'; | ||
import { CalendarView, CalendarBase, NavigatedEventArgs, RenderDayCellEventArgs, CalendarType } from '../calendar/calendar'; | ||
import { Popup } from '@syncfusion/ej2-popups'; | ||
@@ -200,2 +200,8 @@ import { FloatLabelType, FocusEventArgs, BlurEventArgs } from '@syncfusion/ej2-inputs'; | ||
/** | ||
* Gets or sets the Calendar's Type like gregorian or islamic. | ||
* @default Gregorian | ||
* @private | ||
*/ | ||
calendarMode: CalendarType; | ||
/** | ||
* Triggers when Calendar is created. | ||
@@ -202,0 +208,0 @@ * @event |
@@ -1,2 +0,2 @@ | ||
import { EventHandler, Internationalization, Property, NotifyPropertyChanges, Browser, RippleOptions } from '@syncfusion/ej2-base';import { Animation, EmitType, Event, AnimationModel, cldrData, getDefaultDateObject, detach } from '@syncfusion/ej2-base';import { createElement, remove, addClass, L10n, removeClass, closest, classList, append, attributes } from '@syncfusion/ej2-base';import { KeyboardEvents, KeyboardEventArgs, isNullOrUndefined, formatUnit, getValue, rippleEffect } from '@syncfusion/ej2-base';import { Popup } from '@syncfusion/ej2-popups';import { Input, BlurEventArgs } from '@syncfusion/ej2-inputs';import { DatePicker, PopupObjectArgs } from '../datepicker/datepicker';import { TimePickerBase } from '../timepicker/timepicker';import { cssClass as ListBaseClasses } from '@syncfusion/ej2-lists'; | ||
import { EventHandler, Internationalization, Property, NotifyPropertyChanges, Browser, RippleOptions } from '@syncfusion/ej2-base';import { Animation, EmitType, Event, AnimationModel, cldrData, getDefaultDateObject, detach } from '@syncfusion/ej2-base';import { createElement, remove, addClass, L10n, removeClass, closest, classList, append, attributes } from '@syncfusion/ej2-base';import { KeyboardEvents, KeyboardEventArgs, isNullOrUndefined, formatUnit, getValue, rippleEffect } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { Popup } from '@syncfusion/ej2-popups';import { Input, BlurEventArgs } from '@syncfusion/ej2-inputs';import { DatePicker, PopupObjectArgs } from '../datepicker/datepicker';import { TimePickerBase } from '../timepicker/timepicker';import { cssClass as ListBaseClasses } from '@syncfusion/ej2-lists'; | ||
import {DatePickerModel} from "../datepicker/datepicker-model"; | ||
@@ -49,2 +49,9 @@ | ||
/** | ||
* Gets or sets multiple selected dates of the calendar. | ||
* @default null | ||
* @private | ||
*/ | ||
values?: Date[]; | ||
/** | ||
* Specifies whether to show or hide the clear icon in textbox. | ||
@@ -51,0 +58,0 @@ * @default true |
@@ -5,2 +5,3 @@ /// <reference path="../datepicker/datepicker-model.d.ts" /> | ||
import { KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base'; | ||
import { ModuleDeclaration } from '@syncfusion/ej2-base'; | ||
import { DatePicker, PopupObjectArgs } from '../datepicker/datepicker'; | ||
@@ -35,3 +36,3 @@ import { DateTimePickerModel } from './datetimepicker-model'; | ||
private isNavigate; | ||
protected isPreventBlur: boolean; | ||
protected isPreventBlur: Boolean; | ||
private timeValue; | ||
@@ -225,2 +226,3 @@ protected l10n: L10n; | ||
protected checkAttributes(): void; | ||
requiredModules(): ModuleDeclaration[]; | ||
private getTimeActiveElement; | ||
@@ -227,0 +229,0 @@ protected createDateObj(val: Date | string): Date; |
@@ -266,4 +266,10 @@ var __extends = (this && this.__extends) || (function () { | ||
DateTimePicker.prototype.getFormattedValue = function (value) { | ||
var dateOptions; | ||
if (!isNullOrUndefined(value)) { | ||
var dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd' }; | ||
if (this.calendarMode === 'Gregorian') { | ||
dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd' }; | ||
} | ||
else { | ||
dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' }; | ||
} | ||
return this.globalize.formatDate(value, dateOptions); | ||
@@ -356,3 +362,8 @@ } | ||
DateTimePicker.prototype.getCultureTimeObject = function (ld, c) { | ||
return getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld); | ||
if (this.calendarMode === 'Gregorian') { | ||
return getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld); | ||
} | ||
else { | ||
return getValue('main.' + '' + this.locale + '.dates.calendars.islamic.timeFormats.short', ld); | ||
} | ||
}; | ||
@@ -428,4 +439,15 @@ DateTimePicker.prototype.timeHandler = function (e) { | ||
DateTimePicker.prototype.listCreation = function () { | ||
var dateObject; | ||
if (this.calendarMode === 'Gregorian') { | ||
dateObject = this.globalize.parseDate(this.inputElement.value, { | ||
format: this.cldrDateTimeFormat(), type: 'datetime' | ||
}); | ||
} | ||
else { | ||
dateObject = this.globalize.parseDate(this.inputElement.value, { | ||
format: this.cldrDateTimeFormat(), type: 'datetime', calendar: 'islamic' | ||
}); | ||
} | ||
var value = isNullOrUndefined(this.value) ? this.inputElement.value !== '' ? | ||
this.globalize.parseDate(this.inputElement.value, { format: this.cldrDateTimeFormat(), type: 'datetime' }) : | ||
dateObject : | ||
new Date() : this.value; | ||
@@ -512,3 +534,3 @@ this.valueWithMinutes = value; | ||
if (!Browser.isDevice) { | ||
this.isPreventBlur = (Browser.isIE || Browser.info.name === 'edge') && (document.activeElement === this.inputElement); | ||
this.isPreventBlur = ((document.activeElement === this.inputElement) && (Browser.isIE || Browser.info.name === 'edge')); | ||
event.preventDefault(); | ||
@@ -635,3 +657,3 @@ } | ||
this.changedArgs = { | ||
value: this.value, event: e || null, | ||
value: this.value, event: e, | ||
isInteracted: !isNullOrUndefined(e), | ||
@@ -938,2 +960,9 @@ element: this.element | ||
}; | ||
DateTimePicker.prototype.requiredModules = function () { | ||
var modules = []; | ||
if (this) { | ||
modules.push({ args: [this], member: 'islamic' }); | ||
} | ||
return modules; | ||
}; | ||
DateTimePicker.prototype.getTimeActiveElement = function () { | ||
@@ -974,3 +1003,3 @@ if (!isNullOrUndefined(this.dateTimeWrapper)) { | ||
var listCount = this.liCollections.length; | ||
if (!isNullOrUndefined(this.checkDateValue(value)) || !isNullOrUndefined(this.activeIndex)) { | ||
if (!isNullOrUndefined(this.activeIndex) || !isNullOrUndefined(this.checkDateValue(value))) { | ||
if (event.action === 'home') { | ||
@@ -1009,2 +1038,3 @@ dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[0]))); | ||
DateTimePicker.prototype.setTimeValue = function (date, value) { | ||
var dateString; | ||
var time; | ||
@@ -1025,5 +1055,13 @@ var val = this.validateMinMaxRange(value); | ||
} | ||
var dateString = this.globalize.formatDate(time, { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd' | ||
}); | ||
if (this.calendarMode === 'Gregorian') { | ||
dateString = this.globalize.formatDate(time, { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd' | ||
}); | ||
} | ||
else { | ||
dateString = this.globalize.formatDate(time, { | ||
format: !isNullOrUndefined(this.format) ? this.format : this.cldrDateTimeFormat(), | ||
type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' | ||
}); | ||
} | ||
if (!this.strictMode && isNullOrUndefined(time)) { | ||
@@ -1116,2 +1154,3 @@ Input.setValue(dateString, this.inputElement, this.floatLabelType, this.showClearButton); | ||
this.isNavigate = false; | ||
event.stopPropagation(); | ||
break; | ||
@@ -1235,2 +1274,5 @@ case 'escape': | ||
__decorate([ | ||
Property(null) | ||
], DateTimePicker.prototype, "values", void 0); | ||
__decorate([ | ||
Property(true) | ||
@@ -1237,0 +1279,0 @@ ], DateTimePicker.prototype, "showClearButton", void 0); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6243946
234
59113
2