|
|
@@ -480,15 +480,26 @@ class PublicContent extends Component {
|
|
|
isPartition
|
|
|
pickerShow={this.state.isPickerRender}
|
|
|
onconditionaljudgment={(v) => {
|
|
|
- let a = dayjs(
|
|
|
+ let startTimeD = dayjs(
|
|
|
+ dayjs(v.detail.startTime)
|
|
|
+ .second(0)
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss")
|
|
|
+ );
|
|
|
+ let endTimeD = dayjs(
|
|
|
dayjs(v.detail.endTime)
|
|
|
.second(0)
|
|
|
.format("YYYY-MM-DD HH:mm:ss")
|
|
|
);
|
|
|
- let b = dayjs(dayjs().second(0).format("YYYY-MM-DD HH:mm:ss"));
|
|
|
- if (a.isBefore(b)) {
|
|
|
+ let currTimeD = dayjs(dayjs().second(0).format("YYYY-MM-DD HH:mm:ss"));
|
|
|
+ if (!startTimeD.isAfter(currTimeD)) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "开始时间不能小于当前时间",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ v.detail.setLv(false);
|
|
|
+ } else if (!endTimeD.isAfter(startTimeD)) {
|
|
|
Taro.showToast({
|
|
|
- title: "结束时间不能小于当前时间",
|
|
|
+ title: "结束时间不能小于开始时间",
|
|
|
icon: "none",
|
|
|
});
|
|
|
v.detail.setLv(false);
|