##// END OF EJS Templates
dates: Fix bare times to be relative to "today"
Matt Mackall -
r6230:c7253d1a default
parent child Browse files
Show More
@@ -1586,7 +1586,7 b' def parsedate(date, formats=None, defaul'
1586 """
1586 """
1587 if not date:
1587 if not date:
1588 return 0, 0
1588 return 0, 0
1589 if type(date) is type((0, 0)) and len(date) == 2:
1589 if isinstance(date, tuple) and len(date) == 2:
1590 return date
1590 return date
1591 if not formats:
1591 if not formats:
1592 formats = defaultdateformats
1592 formats = defaultdateformats
@@ -1602,8 +1602,6 b' def parsedate(date, formats=None, defaul'
1602 if part not in defaults:
1602 if part not in defaults:
1603 if part[0] in "HMS":
1603 if part[0] in "HMS":
1604 defaults[part] = "00"
1604 defaults[part] = "00"
1605 elif part[0] in "dm":
1606 defaults[part] = "1"
1607 else:
1605 else:
1608 defaults[part] = datestr(now, "%" + part[0])
1606 defaults[part] = datestr(now, "%" + part[0])
1609
1607
@@ -1640,7 +1638,8 b' def matchdate(date):'
1640 """
1638 """
1641
1639
1642 def lower(date):
1640 def lower(date):
1643 return parsedate(date, extendeddateformats)[0]
1641 d = dict(mb="1", d="1")
1642 return parsedate(date, extendeddateformats, d)[0]
1644
1643
1645 def upper(date):
1644 def upper(date):
1646 d = dict(mb="12", HI="23", M="59", S="59")
1645 d = dict(mb="12", HI="23", M="59", S="59")
General Comments 0
You need to be logged in to leave comments. Login now