@codaline-io/ionic-datepicker
Advanced tools
Comparing version 0.0.15-0 to 0.0.15-1
@@ -6,3 +6,3 @@ 'use strict'; | ||
const index = require('./index-1c98651d.js'); | ||
const utils = require('./utils-3600e812.js'); | ||
const utils = require('./utils-2172fc46.js'); | ||
@@ -53,3 +53,3 @@ const variablesCss = ":root,:host{--base-spacing:var(--ion-padding, 16px);--base-spacing-small:calc(var(--base-spacing) * 0.7);--base-spacing-large:calc(var(--base-spacing) * 1.5);--font-size-base:14px;--font-size-small:calc(var(--font-size-base) * 0.9);--font-size-medium:calc(var(--font-size-base) * 1.2);--font-size-large:calc(var(--font-size-base) * 1.4);--text-color:var(--ion-text-color, #424242);--error-color:var(--ion-color-danger, #eb445a);--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999));--popover-width:250px;--square-dimension:33px;--square-border-radius:5px;--square-font-weight:normal;--square-hover-color:var(--ion-color-white, #fff);--square-hover-background:var(--ion-color-secondary, #3dc2ff);--controls-padding:5px;--controls-background:var(--ion-color-white, #fff);--square-active-color:var(--ion-color-white, #fff);--square-active-background:var(--ion-color-primary, #3880ff);--square-current-color:var(--ion-color-white, #fff);--square-current-background:var(--ion-color-medium, #92949c)}"; | ||
onSelect: (instance) => { | ||
document.querySelector('ion-popover').dismiss({ date: instance.dateSelected.toISOString() }); | ||
document.querySelector('ion-popover').dismiss({ date: utils.toISODate(instance.dateSelected.toISOString()) }); | ||
}, | ||
@@ -56,0 +56,0 @@ overlayButton: utils.DEFAULT_OKAY_LABEL, |
@@ -6,3 +6,3 @@ 'use strict'; | ||
const index = require('./index-1c98651d.js'); | ||
const utils = require('./utils-3600e812.js'); | ||
const utils = require('./utils-2172fc46.js'); | ||
@@ -124,12 +124,11 @@ const variablesCss = ":root,:host{--base-spacing:var(--ion-padding, 16px);--base-spacing-small:calc(var(--base-spacing) * 0.7);--base-spacing-large:calc(var(--base-spacing) * 1.5);--font-size-base:14px;--font-size-small:calc(var(--font-size-base) * 0.9);--font-size-medium:calc(var(--font-size-base) * 1.2);--font-size-large:calc(var(--font-size-base) * 1.4);--text-color:var(--ion-text-color, #424242);--error-color:var(--ion-color-danger, #eb445a);--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999));--popover-width:250px;--square-dimension:33px;--square-border-radius:5px;--square-font-weight:normal;--square-hover-color:var(--ion-color-white, #fff);--square-hover-background:var(--ion-color-secondary, #3dc2ff);--controls-padding:5px;--controls-background:var(--ion-color-white, #fff);--square-active-color:var(--ion-color-white, #fff);--square-active-background:var(--ion-color-primary, #3880ff);--square-current-color:var(--ion-color-white, #fff);--square-current-background:var(--ion-color-medium, #92949c)}"; | ||
if (!this.defaultDate || !this.defaultDate.trim()) { | ||
this.defaultDate = utils.toISODate(new Date().toISOString()); | ||
this.defaultDate = new Date().toISOString(); | ||
} | ||
} | ||
if (this.defaultDate) { | ||
this.date = this.defaultDate; | ||
this.formatDate(); | ||
this.formatDate(this.defaultDate); | ||
} | ||
} | ||
formatDate() { | ||
this.formattedDate = utils.renderDatetime(this.displayFormat, this.date, { | ||
formatDate(date) { | ||
this.formattedDate = utils.renderDatetime(this.displayFormat, date, { | ||
dayNames: this.dayNames, | ||
@@ -143,5 +142,4 @@ dayShortNames: this.dayShortNames, | ||
if (!this.disabled) { | ||
this.date = ev.detail.value; | ||
this.formatDate(); | ||
this.changes.emit(utils.toISODate(this.date)); | ||
this.formatDate(ev.detail.value); | ||
this.changes.emit(ev.detail.value); | ||
} | ||
@@ -154,3 +152,3 @@ } | ||
const popover = Object.assign(document.createElement('ion-popover'), Object.assign(Object.assign({}, this.ionPopoverOptions), { component: 'ionic-datepicker-popover', componentProps: { | ||
selectedDate: this.date || null, | ||
selectedDate: this.defaultDate || null, | ||
disabled: this.disabled, | ||
@@ -166,6 +164,3 @@ displayFormat: this.displayFormat, | ||
if (data && data.date) { | ||
this.date = data.date; | ||
this.formatDate(); | ||
const dateString = utils.toISODate(this.date); | ||
this.changes.emit(dateString); | ||
this.formatDate(data.date); | ||
} | ||
@@ -172,0 +167,0 @@ } |
@@ -6,3 +6,3 @@ 'use strict'; | ||
index.patchBrowser().then(options => { | ||
return index.bootstrapLazy([["ionic-datepicker.cjs",[[1,"ionic-datepicker",{"displayFormat":[1,"display-format"],"pickerFormat":[1,"picker-format"],"disabled":[4],"pickerOptions":[16],"defaultDate":[1,"default-date"],"placeholder":[1],"ionDateTimeOnMobile":[4,"ion-date-time-on-mobile"],"max":[1],"min":[1],"required":[4],"error":[4],"ionPopoverOptions":[16],"mode":[1],"errorClass":[1,"error-class"],"monthNames":[16],"monthShortNames":[16],"dayNames":[16],"dayShortNames":[16],"okayLabel":[1,"okay-label"],"cancelLabel":[1,"cancel-label"],"yearLabel":[1,"year-label"],"formattedDate":[32],"date":[32]}]]],["ionic-datepicker-popover.cjs",[[0,"ionic-datepicker-popover",{"disabled":[4],"pickerOptions":[16],"selectedDate":[1,"selected-date"],"max":[1],"min":[1]}]]]], options); | ||
return index.bootstrapLazy([["ionic-datepicker.cjs",[[1,"ionic-datepicker",{"displayFormat":[1,"display-format"],"pickerFormat":[1,"picker-format"],"disabled":[4],"pickerOptions":[16],"defaultDate":[1,"default-date"],"placeholder":[1],"ionDateTimeOnMobile":[4,"ion-date-time-on-mobile"],"max":[1],"min":[1],"required":[4],"error":[4],"ionPopoverOptions":[16],"mode":[1],"errorClass":[1,"error-class"],"monthNames":[16],"monthShortNames":[16],"dayNames":[16],"dayShortNames":[16],"okayLabel":[1,"okay-label"],"cancelLabel":[1,"cancel-label"],"yearLabel":[1,"year-label"],"formattedDate":[32]}]]],["ionic-datepicker-popover.cjs",[[0,"ionic-datepicker-popover",{"disabled":[4],"pickerOptions":[16],"selectedDate":[1,"selected-date"],"max":[1],"min":[1]}]]]], options); | ||
}); |
@@ -8,5 +8,5 @@ 'use strict'; | ||
const defineCustomElements = (win, options) => index.patchEsm().then(() => { | ||
return index.bootstrapLazy([["ionic-datepicker.cjs",[[1,"ionic-datepicker",{"displayFormat":[1,"display-format"],"pickerFormat":[1,"picker-format"],"disabled":[4],"pickerOptions":[16],"defaultDate":[1,"default-date"],"placeholder":[1],"ionDateTimeOnMobile":[4,"ion-date-time-on-mobile"],"max":[1],"min":[1],"required":[4],"error":[4],"ionPopoverOptions":[16],"mode":[1],"errorClass":[1,"error-class"],"monthNames":[16],"monthShortNames":[16],"dayNames":[16],"dayShortNames":[16],"okayLabel":[1,"okay-label"],"cancelLabel":[1,"cancel-label"],"yearLabel":[1,"year-label"],"formattedDate":[32],"date":[32]}]]],["ionic-datepicker-popover.cjs",[[0,"ionic-datepicker-popover",{"disabled":[4],"pickerOptions":[16],"selectedDate":[1,"selected-date"],"max":[1],"min":[1]}]]]], options); | ||
return index.bootstrapLazy([["ionic-datepicker.cjs",[[1,"ionic-datepicker",{"displayFormat":[1,"display-format"],"pickerFormat":[1,"picker-format"],"disabled":[4],"pickerOptions":[16],"defaultDate":[1,"default-date"],"placeholder":[1],"ionDateTimeOnMobile":[4,"ion-date-time-on-mobile"],"max":[1],"min":[1],"required":[4],"error":[4],"ionPopoverOptions":[16],"mode":[1],"errorClass":[1,"error-class"],"monthNames":[16],"monthShortNames":[16],"dayNames":[16],"dayShortNames":[16],"okayLabel":[1,"okay-label"],"cancelLabel":[1,"cancel-label"],"yearLabel":[1,"year-label"],"formattedDate":[32]}]]],["ionic-datepicker-popover.cjs",[[0,"ionic-datepicker-popover",{"disabled":[4],"pickerOptions":[16],"selectedDate":[1,"selected-date"],"max":[1],"min":[1]}]]]], options); | ||
}); | ||
exports.defineCustomElements = defineCustomElements; |
import { Component, h, Prop, Watch } from '@stencil/core'; | ||
import { DAY_SHORT_NAMES, DEFAULT_OKAY_LABEL, DEFAULT_YEAR_LABEL, MONTH_NAMES, MONTH_SHORT_NAMES, DEFAULT_MAX, DEFAULT_MIN } from '../utils'; | ||
import { DAY_SHORT_NAMES, DEFAULT_OKAY_LABEL, DEFAULT_YEAR_LABEL, MONTH_NAMES, MONTH_SHORT_NAMES, DEFAULT_MAX, DEFAULT_MIN, toISODate } from '../utils'; | ||
export class IonicDatepickerPopover { | ||
@@ -42,3 +42,3 @@ constructor() { | ||
onSelect: (instance) => { | ||
document.querySelector('ion-popover').dismiss({ date: instance.dateSelected.toISOString() }); | ||
document.querySelector('ion-popover').dismiss({ date: toISODate(instance.dateSelected.toISOString()) }); | ||
}, | ||
@@ -45,0 +45,0 @@ overlayButton: DEFAULT_OKAY_LABEL, |
import { Component, Prop, h, Host, Event, State } from '@stencil/core'; | ||
import { DEFAULT_MAX, DEFAULT_MIN, DAY_NAMES, DAY_SHORT_NAMES, DEFAULT_CANCEL_LABEL, DEFAULT_OKAY_LABEL, DEFAULT_YEAR_LABEL, MONTH_NAMES, MONTH_SHORT_NAMES, renderDatetime, toISODate } from '../utils'; | ||
import { DEFAULT_MAX, DEFAULT_MIN, DAY_NAMES, DAY_SHORT_NAMES, DEFAULT_CANCEL_LABEL, DEFAULT_OKAY_LABEL, DEFAULT_YEAR_LABEL, MONTH_NAMES, MONTH_SHORT_NAMES, renderDatetime } from '../utils'; | ||
const isDesktop = () => !(window.matchMedia('(any-pointer:coarse)').matches); | ||
@@ -112,12 +112,11 @@ export class IonicDatepicker { | ||
if (!this.defaultDate || !this.defaultDate.trim()) { | ||
this.defaultDate = toISODate(new Date().toISOString()); | ||
this.defaultDate = new Date().toISOString(); | ||
} | ||
} | ||
if (this.defaultDate) { | ||
this.date = this.defaultDate; | ||
this.formatDate(); | ||
this.formatDate(this.defaultDate); | ||
} | ||
} | ||
formatDate() { | ||
this.formattedDate = renderDatetime(this.displayFormat, this.date, { | ||
formatDate(date) { | ||
this.formattedDate = renderDatetime(this.displayFormat, date, { | ||
dayNames: this.dayNames, | ||
@@ -131,5 +130,4 @@ dayShortNames: this.dayShortNames, | ||
if (!this.disabled) { | ||
this.date = ev.detail.value; | ||
this.formatDate(); | ||
this.changes.emit(toISODate(this.date)); | ||
this.formatDate(ev.detail.value); | ||
this.changes.emit(ev.detail.value); | ||
} | ||
@@ -142,3 +140,3 @@ } | ||
const popover = Object.assign(document.createElement('ion-popover'), Object.assign(Object.assign({}, this.ionPopoverOptions), { component: 'ionic-datepicker-popover', componentProps: { | ||
selectedDate: this.date || null, | ||
selectedDate: this.defaultDate || null, | ||
disabled: this.disabled, | ||
@@ -154,6 +152,3 @@ displayFormat: this.displayFormat, | ||
if (data && data.date) { | ||
this.date = data.date; | ||
this.formatDate(); | ||
const dateString = toISODate(this.date); | ||
this.changes.emit(dateString); | ||
this.formatDate(data.date); | ||
} | ||
@@ -558,4 +553,3 @@ } | ||
static get states() { return { | ||
"formattedDate": {}, | ||
"date": {} | ||
"formattedDate": {} | ||
}; } | ||
@@ -562,0 +556,0 @@ static get events() { return [{ |
@@ -154,3 +154,3 @@ export const MONTH_NAMES = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']; | ||
const date = new Date(dateString); | ||
return `${date.getFullYear()}-${date.getMonth() < 10 ? `0${date.getMonth()}` : date.getMonth()}-${date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()}`; | ||
return `${date.getFullYear()}-${date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1}-${date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()}`; | ||
}; | ||
@@ -157,0 +157,0 @@ const FORMAT_YYYY = 'YYYY'; |
import { r as registerInstance, h } from './index-f3e464ac.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, d as DAY_SHORT_NAMES, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, e as DEFAULT_OKAY_LABEL, g as DEFAULT_YEAR_LABEL } from './utils-d4f3bb0d.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, d as DAY_SHORT_NAMES, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, t as toISODate, e as DEFAULT_OKAY_LABEL, g as DEFAULT_YEAR_LABEL } from './utils-f44cc100.js'; | ||
@@ -48,3 +48,3 @@ const variablesCss = ":root,:host{--base-spacing:var(--ion-padding, 16px);--base-spacing-small:calc(var(--base-spacing) * 0.7);--base-spacing-large:calc(var(--base-spacing) * 1.5);--font-size-base:14px;--font-size-small:calc(var(--font-size-base) * 0.9);--font-size-medium:calc(var(--font-size-base) * 1.2);--font-size-large:calc(var(--font-size-base) * 1.4);--text-color:var(--ion-text-color, #424242);--error-color:var(--ion-color-danger, #eb445a);--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999));--popover-width:250px;--square-dimension:33px;--square-border-radius:5px;--square-font-weight:normal;--square-hover-color:var(--ion-color-white, #fff);--square-hover-background:var(--ion-color-secondary, #3dc2ff);--controls-padding:5px;--controls-background:var(--ion-color-white, #fff);--square-active-color:var(--ion-color-white, #fff);--square-active-background:var(--ion-color-primary, #3880ff);--square-current-color:var(--ion-color-white, #fff);--square-current-background:var(--ion-color-medium, #92949c)}"; | ||
onSelect: (instance) => { | ||
document.querySelector('ion-popover').dismiss({ date: instance.dateSelected.toISOString() }); | ||
document.querySelector('ion-popover').dismiss({ date: toISODate(instance.dateSelected.toISOString()) }); | ||
}, | ||
@@ -51,0 +51,0 @@ overlayButton: DEFAULT_OKAY_LABEL, |
import { r as registerInstance, c as createEvent, h, H as Host } from './index-f3e464ac.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, c as DAY_NAMES, d as DAY_SHORT_NAMES, e as DEFAULT_OKAY_LABEL, f as DEFAULT_CANCEL_LABEL, g as DEFAULT_YEAR_LABEL, t as toISODate, r as renderDatetime } from './utils-d4f3bb0d.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, c as DAY_NAMES, d as DAY_SHORT_NAMES, e as DEFAULT_OKAY_LABEL, f as DEFAULT_CANCEL_LABEL, g as DEFAULT_YEAR_LABEL, r as renderDatetime } from './utils-f44cc100.js'; | ||
@@ -119,12 +119,11 @@ const variablesCss = ":root,:host{--base-spacing:var(--ion-padding, 16px);--base-spacing-small:calc(var(--base-spacing) * 0.7);--base-spacing-large:calc(var(--base-spacing) * 1.5);--font-size-base:14px;--font-size-small:calc(var(--font-size-base) * 0.9);--font-size-medium:calc(var(--font-size-base) * 1.2);--font-size-large:calc(var(--font-size-base) * 1.4);--text-color:var(--ion-text-color, #424242);--error-color:var(--ion-color-danger, #eb445a);--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999));--popover-width:250px;--square-dimension:33px;--square-border-radius:5px;--square-font-weight:normal;--square-hover-color:var(--ion-color-white, #fff);--square-hover-background:var(--ion-color-secondary, #3dc2ff);--controls-padding:5px;--controls-background:var(--ion-color-white, #fff);--square-active-color:var(--ion-color-white, #fff);--square-active-background:var(--ion-color-primary, #3880ff);--square-current-color:var(--ion-color-white, #fff);--square-current-background:var(--ion-color-medium, #92949c)}"; | ||
if (!this.defaultDate || !this.defaultDate.trim()) { | ||
this.defaultDate = toISODate(new Date().toISOString()); | ||
this.defaultDate = new Date().toISOString(); | ||
} | ||
} | ||
if (this.defaultDate) { | ||
this.date = this.defaultDate; | ||
this.formatDate(); | ||
this.formatDate(this.defaultDate); | ||
} | ||
} | ||
formatDate() { | ||
this.formattedDate = renderDatetime(this.displayFormat, this.date, { | ||
formatDate(date) { | ||
this.formattedDate = renderDatetime(this.displayFormat, date, { | ||
dayNames: this.dayNames, | ||
@@ -138,5 +137,4 @@ dayShortNames: this.dayShortNames, | ||
if (!this.disabled) { | ||
this.date = ev.detail.value; | ||
this.formatDate(); | ||
this.changes.emit(toISODate(this.date)); | ||
this.formatDate(ev.detail.value); | ||
this.changes.emit(ev.detail.value); | ||
} | ||
@@ -149,3 +147,3 @@ } | ||
const popover = Object.assign(document.createElement('ion-popover'), Object.assign(Object.assign({}, this.ionPopoverOptions), { component: 'ionic-datepicker-popover', componentProps: { | ||
selectedDate: this.date || null, | ||
selectedDate: this.defaultDate || null, | ||
disabled: this.disabled, | ||
@@ -161,6 +159,3 @@ displayFormat: this.displayFormat, | ||
if (data && data.date) { | ||
this.date = data.date; | ||
this.formatDate(); | ||
const dateString = toISODate(this.date); | ||
this.changes.emit(dateString); | ||
this.formatDate(data.date); | ||
} | ||
@@ -167,0 +162,0 @@ } |
import { r as registerInstance, h } from './index-f3e464ac.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, d as DAY_SHORT_NAMES, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, e as DEFAULT_OKAY_LABEL, g as DEFAULT_YEAR_LABEL } from './utils-d4f3bb0d.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, d as DAY_SHORT_NAMES, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, t as toISODate, e as DEFAULT_OKAY_LABEL, g as DEFAULT_YEAR_LABEL } from './utils-f44cc100.js'; | ||
@@ -48,3 +48,3 @@ const variablesCss = ":root,:host{--base-spacing:var(--ion-padding, 16px);--base-spacing-small:calc(var(--base-spacing) * 0.7);--base-spacing-large:calc(var(--base-spacing) * 1.5);--font-size-base:14px;--font-size-small:calc(var(--font-size-base) * 0.9);--font-size-medium:calc(var(--font-size-base) * 1.2);--font-size-large:calc(var(--font-size-base) * 1.4);--text-color:var(--ion-text-color, #424242);--error-color:var(--ion-color-danger, #eb445a);--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999));--popover-width:250px;--square-dimension:33px;--square-border-radius:5px;--square-font-weight:normal;--square-hover-color:var(--ion-color-white, #fff);--square-hover-background:var(--ion-color-secondary, #3dc2ff);--controls-padding:5px;--controls-background:var(--ion-color-white, #fff);--square-active-color:var(--ion-color-white, #fff);--square-active-background:var(--ion-color-primary, #3880ff);--square-current-color:var(--ion-color-white, #fff);--square-current-background:var(--ion-color-medium, #92949c)}"; | ||
onSelect: (instance) => { | ||
document.querySelector('ion-popover').dismiss({ date: instance.dateSelected.toISOString() }); | ||
document.querySelector('ion-popover').dismiss({ date: toISODate(instance.dateSelected.toISOString()) }); | ||
}, | ||
@@ -51,0 +51,0 @@ overlayButton: DEFAULT_OKAY_LABEL, |
import { r as registerInstance, c as createEvent, h, H as Host } from './index-f3e464ac.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, c as DAY_NAMES, d as DAY_SHORT_NAMES, e as DEFAULT_OKAY_LABEL, f as DEFAULT_CANCEL_LABEL, g as DEFAULT_YEAR_LABEL, t as toISODate, r as renderDatetime } from './utils-d4f3bb0d.js'; | ||
import { D as DEFAULT_MAX, a as DEFAULT_MIN, M as MONTH_NAMES, b as MONTH_SHORT_NAMES, c as DAY_NAMES, d as DAY_SHORT_NAMES, e as DEFAULT_OKAY_LABEL, f as DEFAULT_CANCEL_LABEL, g as DEFAULT_YEAR_LABEL, r as renderDatetime } from './utils-f44cc100.js'; | ||
@@ -119,12 +119,11 @@ const variablesCss = ":root,:host{--base-spacing:var(--ion-padding, 16px);--base-spacing-small:calc(var(--base-spacing) * 0.7);--base-spacing-large:calc(var(--base-spacing) * 1.5);--font-size-base:14px;--font-size-small:calc(var(--font-size-base) * 0.9);--font-size-medium:calc(var(--font-size-base) * 1.2);--font-size-large:calc(var(--font-size-base) * 1.4);--text-color:var(--ion-text-color, #424242);--error-color:var(--ion-color-danger, #eb445a);--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999));--popover-width:250px;--square-dimension:33px;--square-border-radius:5px;--square-font-weight:normal;--square-hover-color:var(--ion-color-white, #fff);--square-hover-background:var(--ion-color-secondary, #3dc2ff);--controls-padding:5px;--controls-background:var(--ion-color-white, #fff);--square-active-color:var(--ion-color-white, #fff);--square-active-background:var(--ion-color-primary, #3880ff);--square-current-color:var(--ion-color-white, #fff);--square-current-background:var(--ion-color-medium, #92949c)}"; | ||
if (!this.defaultDate || !this.defaultDate.trim()) { | ||
this.defaultDate = toISODate(new Date().toISOString()); | ||
this.defaultDate = new Date().toISOString(); | ||
} | ||
} | ||
if (this.defaultDate) { | ||
this.date = this.defaultDate; | ||
this.formatDate(); | ||
this.formatDate(this.defaultDate); | ||
} | ||
} | ||
formatDate() { | ||
this.formattedDate = renderDatetime(this.displayFormat, this.date, { | ||
formatDate(date) { | ||
this.formattedDate = renderDatetime(this.displayFormat, date, { | ||
dayNames: this.dayNames, | ||
@@ -138,5 +137,4 @@ dayShortNames: this.dayShortNames, | ||
if (!this.disabled) { | ||
this.date = ev.detail.value; | ||
this.formatDate(); | ||
this.changes.emit(toISODate(this.date)); | ||
this.formatDate(ev.detail.value); | ||
this.changes.emit(ev.detail.value); | ||
} | ||
@@ -149,3 +147,3 @@ } | ||
const popover = Object.assign(document.createElement('ion-popover'), Object.assign(Object.assign({}, this.ionPopoverOptions), { component: 'ionic-datepicker-popover', componentProps: { | ||
selectedDate: this.date || null, | ||
selectedDate: this.defaultDate || null, | ||
disabled: this.disabled, | ||
@@ -161,6 +159,3 @@ displayFormat: this.displayFormat, | ||
if (data && data.date) { | ||
this.date = data.date; | ||
this.formatDate(); | ||
const dateString = toISODate(this.date); | ||
this.changes.emit(dateString); | ||
this.formatDate(data.date); | ||
} | ||
@@ -167,0 +162,0 @@ } |
@@ -1,1 +0,1 @@ | ||
import{p as e,b as a}from"./p-a9232c04.js";e().then(e=>a([["p-bb395ca4",[[1,"ionic-datepicker",{displayFormat:[1,"display-format"],pickerFormat:[1,"picker-format"],disabled:[4],pickerOptions:[16],defaultDate:[1,"default-date"],placeholder:[1],ionDateTimeOnMobile:[4,"ion-date-time-on-mobile"],max:[1],min:[1],required:[4],error:[4],ionPopoverOptions:[16],mode:[1],errorClass:[1,"error-class"],monthNames:[16],monthShortNames:[16],dayNames:[16],dayShortNames:[16],okayLabel:[1,"okay-label"],cancelLabel:[1,"cancel-label"],yearLabel:[1,"year-label"],formattedDate:[32],date:[32]}]]],["p-680f8510",[[0,"ionic-datepicker-popover",{disabled:[4],pickerOptions:[16],selectedDate:[1,"selected-date"],max:[1],min:[1]}]]]],e)); | ||
import{p as e,b as a}from"./p-a9232c04.js";e().then(e=>a([["p-50716eae",[[1,"ionic-datepicker",{displayFormat:[1,"display-format"],pickerFormat:[1,"picker-format"],disabled:[4],pickerOptions:[16],defaultDate:[1,"default-date"],placeholder:[1],ionDateTimeOnMobile:[4,"ion-date-time-on-mobile"],max:[1],min:[1],required:[4],error:[4],ionPopoverOptions:[16],mode:[1],errorClass:[1,"error-class"],monthNames:[16],monthShortNames:[16],dayNames:[16],dayShortNames:[16],okayLabel:[1,"okay-label"],cancelLabel:[1,"cancel-label"],yearLabel:[1,"year-label"],formattedDate:[32]}]]],["p-6509c551",[[0,"ionic-datepicker-popover",{disabled:[4],pickerOptions:[16],selectedDate:[1,"selected-date"],max:[1],min:[1]}]]]],e)); |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-6b312a4f.system.js"],(function(){"use strict";var e,a;return{setters:[function(t){e=t.p;a=t.b}],execute:function(){e().then(e=>a([["p-73660b51.system",[[1,"ionic-datepicker",{displayFormat:[1,"display-format"],pickerFormat:[1,"picker-format"],disabled:[4],pickerOptions:[16],defaultDate:[1,"default-date"],placeholder:[1],ionDateTimeOnMobile:[4,"ion-date-time-on-mobile"],max:[1],min:[1],required:[4],error:[4],ionPopoverOptions:[16],mode:[1],errorClass:[1,"error-class"],monthNames:[16],monthShortNames:[16],dayNames:[16],dayShortNames:[16],okayLabel:[1,"okay-label"],cancelLabel:[1,"cancel-label"],yearLabel:[1,"year-label"],formattedDate:[32],date:[32]}]]],["p-d19d60b6.system",[[0,"ionic-datepicker-popover",{disabled:[4],pickerOptions:[16],selectedDate:[1,"selected-date"],max:[1],min:[1]}]]]],e))}}})); | ||
System.register(["./p-6b312a4f.system.js"],(function(){"use strict";var e,a;return{setters:[function(t){e=t.p;a=t.b}],execute:function(){e().then(e=>a([["p-dccc0580.system",[[1,"ionic-datepicker",{displayFormat:[1,"display-format"],pickerFormat:[1,"picker-format"],disabled:[4],pickerOptions:[16],defaultDate:[1,"default-date"],placeholder:[1],ionDateTimeOnMobile:[4,"ion-date-time-on-mobile"],max:[1],min:[1],required:[4],error:[4],ionPopoverOptions:[16],mode:[1],errorClass:[1,"error-class"],monthNames:[16],monthShortNames:[16],dayNames:[16],dayShortNames:[16],okayLabel:[1,"okay-label"],cancelLabel:[1,"cancel-label"],yearLabel:[1,"year-label"],formattedDate:[32]}]]],["p-6b22617b.system",[[0,"ionic-datepicker-popover",{disabled:[4],pickerOptions:[16],selectedDate:[1,"selected-date"],max:[1],min:[1]}]]]],e))}}})); |
@@ -117,6 +117,2 @@ import { PopoverOptions, Mode } from '@ionic/core'; | ||
formattedDate: string; | ||
/** | ||
* Stores the current selected date as iso string | ||
*/ | ||
date: string; | ||
private isDesktop; | ||
@@ -123,0 +119,0 @@ constructor(); |
{ | ||
"name": "@codaline-io/ionic-datepicker", | ||
"version": "0.0.15-0", | ||
"version": "0.0.15-1", | ||
"description": "A datepicker component for ionic", | ||
@@ -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
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
823087
11050