fix: add yesterday as special case
This commit is contained in:
parent
981d7eeda0
commit
c6ff971246
@ -44,7 +44,7 @@ symbols = ['!', ',', '@', '#', '$', '%', '^', '&', '*', '?']
|
|||||||
|
|
||||||
transformations = [dict(zip((x + 's' for x in multipliers.keys()), multipliers.keys()))]
|
transformations = [dict(zip((x + 's' for x in multipliers.keys()), multipliers.keys()))]
|
||||||
transformations.append(dict(zip(direction.keys(), (x + ' ' + '1' for x in direction.keys()))))
|
transformations.append(dict(zip(direction.keys(), (x + ' ' + '1' for x in direction.keys()))))
|
||||||
transformations.append({ 'tomorrow': 'next day' })
|
transformations.append({ 'tomorrow': 'next day', 'yesterday': 'past 1 day' })
|
||||||
transformations.append({ 'next': '1', 'upcoming': '1', 'following': '1', 'a': '1', 'an': '1' })
|
transformations.append({ 'next': '1', 'upcoming': '1', 'following': '1', 'a': '1', 'an': '1' })
|
||||||
|
|
||||||
keywords = list(multipliers.keys()) + months + months_short + years + days + days_short + list(direction.keys()) + [time_prefix] + time_postfix
|
keywords = list(multipliers.keys()) + months + months_short + years + days + days_short + list(direction.keys()) + [time_prefix] + time_postfix
|
||||||
|
@ -99,6 +99,7 @@ class HumanDateTests(unittest.TestCase):
|
|||||||
'a week ago': self.today - timedelta(days=7),
|
'a week ago': self.today - timedelta(days=7),
|
||||||
'a month ago': self.today - timedelta(days=30),
|
'a month ago': self.today - timedelta(days=30),
|
||||||
'a year past': self.today - timedelta(days=365),
|
'a year past': self.today - timedelta(days=365),
|
||||||
|
'yesterday': self.today - timedelta(days=1),
|
||||||
}
|
}
|
||||||
|
|
||||||
for (k, date) in tests.items():
|
for (k, date) in tests.items():
|
||||||
|
Loading…
Reference in New Issue
Block a user