Skip to content

Commit

Permalink
change timechuo
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunlong.Zhang authored and Yunlong.Zhang committed Jun 21, 2018
1 parent bb45acb commit 8e690a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pages/timechuo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ Page({
},
//获取得到时间日期值
getdatetime: function (e) {

var that = this;
var txtval = e.detail.value;
console.log("日期时间的值:" + txtval);
that.setData({
datetimeval: txtval
})
Expand All @@ -69,8 +71,9 @@ Page({
} else {
//转为时间戳
var datetimeval = that.data.datetimeval;
console.log("被转换的日期时间的值:" + datetimeval);
var result = timetool.DateTimeToChuo(datetimeval);

console.log("转换的日期时间的值:" + result);
that.setData({
datetimechuo: result,
})
Expand Down
5 changes: 3 additions & 2 deletions pages/timechuo/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<view class='hangview'>
<view class='titletxt'>时间戳值:</view>
<view class='timev'>
<input type='number' class='txtcss' placeholder='请输入时间戳的值' focus='true' placeholder-class='tipcss' value='{{timechuo}}' bindblur='gettimechuo' bindconfirm='gettimechuo'></input>
<input type='number' class='txtcss' placeholder='请输入时间戳的值'
placeholder-class='tipcss' value='{{timechuo}}' bindblur='gettimechuo' bindinput='gettimechuo' bindconfirm='gettimechuo'></input>
</view>
</view>

Expand Down Expand Up @@ -42,7 +43,7 @@
<view class='hangview' style='margin-top:40rpx;'>
<view class='titletxt'>日期时间:</view>
<view class='timev'>
<input type='number' class='txtcss' placeholder='请输入日期时间值yyyy-mm-dd HH:mm:ss' focus='true' placeholder-class='tipcss' value='{{datetimeval}}' bindblur='getdatetime' bindconfirm='getdatetime'></input>
<input type='text' class='txtcss' placeholder='请输入yyyy-mm-dd HH:mm:ss' focus='true' placeholder-class='tipcss' value='{{datetimeval}}' bindinput='getdatetime' bindblur='getdatetime' bindconfirm='getdatetime'></input>
</view>
</view>

Expand Down

0 comments on commit 8e690a3

Please sign in to comment.