fix:调整循环密码的失效时间问题
This commit is contained in:
parent
f17a7feb9c
commit
493fc19033
@ -295,21 +295,24 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
action: () {
|
||||
final PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate,
|
||||
// maxDate传入三年以后得今天的时间
|
||||
maxDate: PDuration(
|
||||
year: DateTime.now().year + 3,
|
||||
month: DateTime.now().month,
|
||||
day: DateTime.now().day),
|
||||
minDate: PDuration(
|
||||
year: DateTime.now().year,
|
||||
month: DateTime.now().month,
|
||||
day: DateTime.now().day),
|
||||
mode: DateMode.YMDH,
|
||||
hourShow24: true, onConfirm: (PDuration p) {
|
||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||
});
|
||||
Pickers.showDatePicker(
|
||||
context,
|
||||
selectDate: selectDate,
|
||||
// maxDate传入三年以后得今天的时间
|
||||
maxDate: PDuration(
|
||||
year: DateTime.now().year + 3,
|
||||
month: DateTime.now().month,
|
||||
day: DateTime.now().day),
|
||||
minDate: PDuration(
|
||||
year: DateTime.now().year,
|
||||
month: DateTime.now().month,
|
||||
day: DateTime.now().day),
|
||||
mode: DateMode.YMDH,
|
||||
hourShow24: true,
|
||||
onConfirm: (PDuration p) {
|
||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||
},
|
||||
);
|
||||
}),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
@ -427,19 +430,20 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
CommonDataManage().currentKeyInfo.model ==
|
||||
IoModelVendor.model_XL_WIFI),
|
||||
child: CommonItem(
|
||||
leftTitel: '结束日期'.tr,
|
||||
rightTitle: state.endTime.value,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
final PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate,
|
||||
mode: DateMode.YMDH, onConfirm: (PDuration p) {
|
||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||
});
|
||||
}),
|
||||
leftTitel: '结束日期'.tr,
|
||||
rightTitle: state.endTime.value,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
final PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate,
|
||||
mode: DateMode.YMDH, onConfirm: (PDuration p) {
|
||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: '生效时间'.tr,
|
||||
@ -458,20 +462,26 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
}, hourShow24: true);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: '失效时间'.tr,
|
||||
rightTitle: state.loopFailureDate.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTool().dateToDateTime(state.loopFailureDate.value, 0));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate,
|
||||
mode: DateMode.H, onConfirm: (PDuration p) {
|
||||
leftTitel: '失效时间'.tr,
|
||||
rightTitle: state.loopFailureDate.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTool().dateToDateTime(state.loopFailureDate.value, 0));
|
||||
Pickers.showDatePicker(
|
||||
context,
|
||||
selectDate: selectDate,
|
||||
mode: DateMode.H,
|
||||
onConfirm: (PDuration p) {
|
||||
state.loopFailureDate.value =
|
||||
DateTool().getYMDHNDateString(p, 5);
|
||||
state.loopEndHours.value = p.hour!;
|
||||
}, hourShow24: true);
|
||||
}),
|
||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||
},
|
||||
hourShow24: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user