Explorar o código

外网首页更换

yf_ymm %!s(int64=5) %!d(string=hai) anos
pai
achega
4d5cbf3a95
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      apps/Equipment/views.py

+ 6 - 2
apps/Equipment/views.py

@@ -1334,6 +1334,10 @@ class Sightsee_Pub(ListView):
         sightsee_img = request.POST.get('img_url')
         sightsee_stime = request.POST.get('stime')
         sightsee_etime = request.POST.get('etime')
+        begindate = re.findall(r"\d+\.?\d*", sightsee_stime)
+        enddate = re.findall(r"\d+\.?\d*", sightsee_etime)
+        start_date = datetime.date(int(begindate[0]), int(begindate[1]), int(begindate[2]))
+        end_date = datetime.date(int(enddate[0]), int(enddate[1]), int(enddate[2]))
         # 位置
         location = request.POST.get('location')
         addr = request.POST.get('addr')
@@ -1345,8 +1349,8 @@ class Sightsee_Pub(ListView):
             name=name,
             price=price,
             location=location,
-            sightsee_stime=sightsee_stime,
-            sightsee_etime=sightsee_etime,
+            sightsee_stime=start_date,
+            sightsee_etime=end_date,
             sightsee_img=sightsee_img,
             sightsee_tel=sightsee_tel,
             addr=addr,