Skip to content

Commit

Permalink
-1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
QlQlqiqi committed Sep 17, 2021
1 parent 4ecff8d commit 435d9b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/components/time/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ Component({
*/
properties: {
// 世界时间格式
defaultTime: String
defaultTime: String,
// 显示日期的长度
timeLength: {
type: Number,
value: 30
}
},

/**
Expand Down Expand Up @@ -125,7 +130,7 @@ Component({
let {multiArray, multiIndex} = this.data;
// 月-日
let defaultMD = month + '-' + day;
for (let i = 0, oneDay = 24 * 60 * 60 * 1000; i <= 180; i++) {
for (let i = 0, oneDay = 24 * 60 * 60 * 1000; i <= this.properties.timeLength; i++) {
let tmpMD = date.getUTCMonth() + 1 + "-" + date.getUTCDate();
if(defaultMD === tmpMD)
multiIndex[0] = i;
Expand Down
7 changes: 6 additions & 1 deletion src/components/time/time.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<!--
接受一个世界时格式的时间 defaultTime ,表示从此刻时间开始,可以选择后 timeLength 天日期,
默认 30 天,并在选择确定后触发一个 handleChangeTime 事件,data 为世界时格式的 time
-->

<picker class='time-picker' mode="multiSelector" bindchange="bindStartMultiPickerChange"
bindtap='pickerTap' bindcolumnchange="bindMultiPickerColumnChange" value="{{ multiIndex }}"
range="{{ multiArray }}"
>
{{startDate}}
{{ startDate }}
</picker>
2 changes: 1 addition & 1 deletion src/pages/editor/editor.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<view class="editor-time-wrap">
<image src="/src/image/editor-date.svg" mode="aspectFit" style="top: 32rpx; left: 24rpx;"></image>
<view style="display: inline-block; margin-left: 84rpx; font-weight: bold;">时间</view>
<time class="editor-time-text" defaultTime="{{ task.date }}" catch:handleChangeTime="handleChangeTime"></time>
<time class="editor-time-text" defaultTime="{{ task.date }}" timeLength="{{ 180 }}" catch:handleChangeTime="handleChangeTime"></time>
</view>

<view style="height: 2rpx; border-top: 2rpx rgba(255, 255, 255, 0.63) solid;"></view>
Expand Down

0 comments on commit 435d9b2

Please sign in to comment.