mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-09-30 10:13:11 +00:00
Merge remote-tracking branch 'origin/main' into feature/134-clarify-drop-shift-night-differentiation
# Conflicts: # src/slack-bot/app.py # tests/slack_bot/test_parse_date.py
This commit is contained in:
commit
5f891d867a
2 changed files with 14 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ _DATED_FORMATS = (
|
|||
"%Y-%m-%d",
|
||||
"%m/%d/%Y",
|
||||
"%m/%d/%y",
|
||||
"%m-%d-%Y",
|
||||
"%m-%d-%y",
|
||||
"%b %d %Y",
|
||||
"%B %d %Y",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,19 @@ def test_two_digit_year_dash(slackbot_app):
|
|||
assert slackbot_app.parse_date("7-3-26").strftime("%Y-%m-%d") == "2026-07-03"
|
||||
|
||||
|
||||
@freeze_time(FROZEN)
|
||||
def test_four_digit_year_dash(slackbot_app):
|
||||
assert slackbot_app.parse_date("7-3-2026").strftime("%Y-%m-%d") == "2026-07-03"
|
||||
|
||||
|
||||
@freeze_time(FROZEN)
|
||||
def test_two_digit_year_century_boundary(slackbot_app):
|
||||
# Python's %y maps 00–68 → 2000s and 69–99 → 1900s. Pin it so nobody
|
||||
# "fixes" the ambiguity by accident later.
|
||||
assert slackbot_app.parse_date("12/31/99").year == 1999
|
||||
assert slackbot_app.parse_date("1/1/68").year == 2068
|
||||
|
||||
|
||||
@freeze_time(FROZEN)
|
||||
def test_two_digit_year_past_not_rolled(slackbot_app):
|
||||
# Explicit two-digit year in the past stays put — no roll-forward.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue