Spaces:
Sleeping
Sleeping
File size: 1,296 Bytes
e8510d3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/usr/bin/env python
from utils import date_to_words
from datetime import datetime
# Test some different dates to verify the output
dates_to_test = [
"2025-06-15", # Full date (fifteenth June two thousand twenty-five)
"2025-06", # Year-month (June two thousand twenty-five)
"2025", # Just year (two thousand twenty-five)
"2019", # Year in 2010s (two thousand nineteen)
"1999", # Year in 1990s (nineteen hundred ninety-nine)
"1950", # Year in 1950s (nineteen hundred fifty)
"1900", # Year 1900 (nineteen hundred)
"1800", # Year 1800 (eighteen hundred)
"1700", # Year 1700 (seventeen hundred)
"1500", # Year 1500 (fifteen hundred)
"1100", # Year 1100 (eleven hundred)
"1099", # Year 1099 (one thousand ninety-nine)
"1000", # Year 1000 (one thousand)
"2000", # Year 2000 (two thousand)
"2025-06-07" # Today (seventh June two thousand twenty-five)
]
print("Testing date_to_words function:")
print("-" * 50)
for date_str in dates_to_test:
result = date_to_words(date_str)
print(f"{date_str} -> {result}")
# Also test with datetime objects
today = datetime.now()
print(f"\nToday ({today.strftime('%Y-%m-%d')}) -> {date_to_words(today)}")
|