|
|
@@ -517,29 +517,34 @@ public class SelectCalendarActivity extends BaseActivity implements View.OnClick
|
|
|
int yeas = c.get(Calendar.YEAR);
|
|
|
int month = c.get(Calendar.MONTH) + 1;
|
|
|
int day = c.get(Calendar.DAY_OF_MONTH);
|
|
|
- String m = "";
|
|
|
- String d = "";
|
|
|
- if (month < 10) {
|
|
|
- m = "0" + month;
|
|
|
- } else {
|
|
|
- m = month + "";
|
|
|
- }
|
|
|
- if (day < 10) {
|
|
|
- d = "0" + day;
|
|
|
- } else {
|
|
|
- d = day + "";
|
|
|
- }
|
|
|
- if (startDate) {
|
|
|
- v_date_start.setText(yeas + "-" + m + "-" + d + " " + start_hour_min);
|
|
|
- Log.d("Slide_date88", yeas + "-" + month + "-" + day + " " + start_hour_min);
|
|
|
- } else {
|
|
|
- v_date_end.setText(yeas + "-" + m + "-" + d + " " + end_hour_min);
|
|
|
- Log.d("Slide_date88", yeas + "-" + month + "-" + day + " " + end_hour_min);
|
|
|
- }
|
|
|
-
|
|
|
+ String today = DateFormatUtil.getDateStr();
|
|
|
+ currentSelectDate = DateFormatUtil.getStrDate4Date(date, "yyyy-MM-dd");
|
|
|
+// if (today.compareTo(currentSelectDate) > 0 && type == 1){
|
|
|
+// ToastMessage("不能预约过去时间");
|
|
|
+// return;
|
|
|
+// }else {
|
|
|
+ String m = "";
|
|
|
+ String d = "";
|
|
|
+ if (month < 10) {
|
|
|
+ m = "0" + month;
|
|
|
+ } else {
|
|
|
+ m = month + "";
|
|
|
+ }
|
|
|
+ if (day < 10) {
|
|
|
+ d = "0" + day;
|
|
|
+ } else {
|
|
|
+ d = day + "";
|
|
|
+ }
|
|
|
+ if (startDate) {
|
|
|
+ v_date_start.setText(yeas + "-" + m + "-" + d + " " + start_hour_min);
|
|
|
+ Log.d("Slide_date88", yeas + "-" + month + "-" + day + " " + start_hour_min);
|
|
|
+ } else {
|
|
|
+ v_date_end.setText(yeas + "-" + m + "-" + d + " " + end_hour_min);
|
|
|
+ Log.d("Slide_date88", yeas + "-" + month + "-" + day + " " + end_hour_min);
|
|
|
+ }
|
|
|
|
|
|
- currentSelectDate = DateFormatUtil.getStrDate4Date(date, "yyyy-MM-dd");
|
|
|
getBookingTime(imId);
|
|
|
+// }
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -1030,10 +1035,13 @@ public class SelectCalendarActivity extends BaseActivity implements View.OnClick
|
|
|
try {
|
|
|
CalendarDateFragmet fragmet = (CalendarDateFragmet) object;
|
|
|
fragmet.setDownDay(selectDay);
|
|
|
+ ;
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private Map<String, OnTaskChangeListener> listenerMap;
|
|
|
@@ -1052,28 +1060,35 @@ public class SelectCalendarActivity extends BaseActivity implements View.OnClick
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
c.setTime(date);
|
|
|
selectDay = c.get(Calendar.DAY_OF_MONTH);
|
|
|
- if (swich) {
|
|
|
- //按时间段
|
|
|
- if (startDate) {
|
|
|
- v_date_start.setText(currentSelectDate);
|
|
|
- } else {
|
|
|
- v_date_end.setText(currentSelectDate);
|
|
|
- }
|
|
|
+ String today = DateFormatUtil.getDateStr();
|
|
|
+ if (today.compareTo(currentSelectDate) > 0 && type == 1){
|
|
|
+ ToastMessage("不能预约过去时间");
|
|
|
+ return;
|
|
|
+ }else {
|
|
|
+ if (swich) {
|
|
|
+ //按时间段
|
|
|
+ if (startDate) {
|
|
|
+ v_date_start.setText(currentSelectDate);
|
|
|
+ } else {
|
|
|
+ v_date_end.setText(currentSelectDate);
|
|
|
+ }
|
|
|
|
|
|
- } else {
|
|
|
- //按时间
|
|
|
- // v_date_start.setText(DateFormatUtil.getStrDate4Date(date,"yyyy-MM-dd"));
|
|
|
- //按时间请假:
|
|
|
- if (startDate) {//按钮状态
|
|
|
- //开始时间
|
|
|
- v_date_start.setText(currentSelectDate);
|
|
|
} else {
|
|
|
- //结束时间
|
|
|
- v_date_end.setText(currentSelectDate);
|
|
|
+ //按时间
|
|
|
+ // v_date_start.setText(DateFormatUtil.getStrDate4Date(date,"yyyy-MM-dd"));
|
|
|
+ //按时间请假:
|
|
|
+ if (startDate) {//按钮状态
|
|
|
+ //开始时间
|
|
|
+ v_date_start.setText(currentSelectDate);
|
|
|
+ } else {
|
|
|
+ //结束时间
|
|
|
+ v_date_end.setText(currentSelectDate);
|
|
|
+ }
|
|
|
}
|
|
|
+ //ToastMessage(currentSelectDate);
|
|
|
+ getBookingTime(imId);
|
|
|
}
|
|
|
- //ToastMessage(currentSelectDate);
|
|
|
- getBookingTime(imId);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|