Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(739)

Unified Diff: tryton/common/date_widget.py

Issue 186056: Don't strip 0 in year completion for issue1370 (Closed)
Patch Set: Prepend '0' to year with length of 1 Created 14 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tryton/common/date_widget.py
===================================================================
--- a/tryton/common/date_widget.py
+++ b/tryton/common/date_widget.py
@@ -163,12 +163,15 @@
n = len(val)
val = val.strip()
val = val.strip('_')
- val = val.lstrip('0')
+ if n != 4:
+ val = val.lstrip('0')
if not val:
continue
fchar = '0'
if n == 4:
fchar = '_'
+ if len(val) == 1:
+ val = '0' + val
val = (fchar * (n - len(val))) + val
start = match.start(i + 1)
end = match.end(i + 1)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b