diff frontends/src/jp/cmd_event.py @ 2247:0f3bfe89999e

jp (event): don't use dayfirst for YY-MM-DD style dates
author Goffi <goffi@goffi.org>
date Sun, 21 May 2017 15:47:53 +0200
parents 9d49e66bdbf2
children 5b04fc0c663d
line wrap: on
line diff
--- a/frontends/src/jp/cmd_event.py	Fri May 19 13:53:52 2017 +0200
+++ b/frontends/src/jp/cmd_event.py	Sun May 21 15:47:53 2017 +0200
@@ -81,7 +81,7 @@
                 date = int(self.args.date)
             except ValueError:
                 try:
-                    date_time = du_parser.parse(self.args.date, dayfirst=True)
+                    date_time = du_parser.parse(self.args.date, dayfirst=not (u'-' in self.args.date))
                 except ValueError as e:
                     self.parser.error(_(u"Can't parse date: {msg}").format(msg=e))
                 if date_time.tzinfo is None: