From de4413c9cfc0a5cb97bf74db5372434f2e537e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B8=9E=E0=B8=87=E0=B8=A8=E0=B9=8C=E0=B8=9B=E0=B8=93?= =?UTF-8?q?=E0=B8=95=20=E0=B8=97=E0=B8=B1=E0=B8=A8=E0=B8=99=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=B2=E0=B8=8A=E0=B8=B8=E0=B8=A1=E0=B8=9E=E0=B8=B2?= =?UTF-8?q?=E0=B8=A5=E0=B8=B5?= Date: Tue, 7 Aug 2018 18:00:26 +0700 Subject: [PATCH] update --- aqa-date-picker-panel.html | 3 +-- aqa-date-picker.html | 20 +++++++++++--------- demo/index.html | 5 +++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/aqa-date-picker-panel.html b/aqa-date-picker-panel.html index d9bccdd..5ed08d2 100644 --- a/aqa-date-picker-panel.html +++ b/aqa-date-picker-panel.html @@ -253,7 +253,6 @@ value: i }) } - console.log(list) return list } }, @@ -353,7 +352,7 @@ // ถ้าไม่ได้กด วันที่เป็นค่าว่าง if(!e.model.item.offset) { this.value = e.model.item.date - this.element.valuePanel = e.model.item.date + this.element.value = e.model.item.date // setTimeout((e)=>this._close(),500) this._close() } diff --git a/aqa-date-picker.html b/aqa-date-picker.html index 54ec81a..fe5d735 100644 --- a/aqa-date-picker.html +++ b/aqa-date-picker.html @@ -35,13 +35,14 @@ static get is() { return 'aqa-date-picker'; } static get properties() { return { - valuePanel: { - type: String, - observer: '_valuePanelChanged' - }, + // valuePanel: { + // type: String, + // observer: '_valuePanelChanged' + // }, value: { type: String, + nofify:true, observer: '_valueChanged', value:"" } @@ -69,7 +70,8 @@ _activePanel() { var valueChild = this.child.value - if(valueChild=="" || valueChild==undefined){ + + if(valueChild=="" || valueChild==undefined || isNaN(valueChild)){ this.panel.value = "" }else{ this.panel.value = parseInt(valueChild.substring(4, 8))-543 + "-" + valueChild.substring(2, 4) + "-" +valueChild.substring(0, 2) @@ -92,10 +94,10 @@ } } - _valuePanelChanged(val){ - var dataArr = val.split("-") - this.child.value = dataArr[2] + dataArr[1] + (parseInt(dataArr[0])+543) - } + // _valuePanelChanged(val){ + // var dataArr = val.split("-") + // this.child.value = dataArr[2] + dataArr[1] + (parseInt(dataArr[0])+543) + // } diff --git a/demo/index.html b/demo/index.html index 4d6247d..3fee1f1 100644 --- a/demo/index.html +++ b/demo/index.html @@ -42,10 +42,11 @@

Basic aqa-form demo

- - + + +