Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
พงศ์ปณต ทัศนียาชุมพาลี authored and พงศ์ปณต ทัศนียาชุมพาลี committed Aug 7, 2018
1 parent c34f908 commit de4413c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
3 changes: 1 addition & 2 deletions aqa-date-picker-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@
value: i
})
}
console.log(list)
return list
}
},
Expand Down Expand Up @@ -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()
}
Expand Down
20 changes: 11 additions & 9 deletions aqa-date-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -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:""
}
Expand Down Expand Up @@ -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)
Expand All @@ -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)
// }



Expand Down
5 changes: 3 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ <h3>Basic aqa-form demo</h3>
</script>
</template>
</dom-bind>

<aqa-date-picker value="">
<aqa-date-picker value="{{x}}">
<aqa-input label="วันเกิด"></aqa-input>
</aqa-date-picker>


<aqa-date-picker value="2018-09-15">
<aqa-input label="วันเกิด"></aqa-input>
</aqa-date-picker>
Expand Down

0 comments on commit de4413c

Please sign in to comment.