예제 #1
0
 def post(self):
     dd = self.request.get('datepicker')
     usr = UserLocale.gql("WHERE user=:u",u=users.get_current_user()).get()
     if usr :
         i18n.get_i18n().set_locale(usr.locale)
         if usr.dateformat or usr.dateformat == '':
             thedate=i18n.parse_date(dd)
             da = DateS(dat=thedate)
         else:
             datef = usr.dateformat
             isoformat = common.isotopyformat(datef)
             thedate = datetime.strptime(dd, isoformat).date()
             da = DateS(dat=thedate)
     else:
         i18n.get_i18n().set_locale(self.browser_locale())
         thedate=i18n.parse_date(dd)
         da = DateS(dat=thedate)
         
     da.put()
     self.redirect('/')