Phase 3 complete: DateTimeBox fully implemented and tested

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-11 20:38:39 +00:00
parent 738a026466
commit 2d3b6adf09
5 changed files with 55 additions and 3 deletions

43
test_datetime_box.nyash Normal file
View File

@ -0,0 +1,43 @@
// test_datetime_box.nyash - DateTimeBox functionality test
// Phase 3: DateTimeBox implementation validation
print("📅 Testing DateTimeBox implementation...")
// Basic DateTimeBox creation
local now, timestamp_dt, parsed_dt, result
// Test 1: Current time creation
now = new DateTimeBox()
print("Current time: " + now.toString())
// Test 2: Timestamp creation
timestamp_dt = new DateTimeBox(1640995200) // 2022-01-01 00:00:00 UTC
print("From timestamp: " + timestamp_dt.toString())
// Test 3: Date component extraction
result = now.year()
print("Current year: " + result.toString())
result = now.month()
print("Current month: " + result.toString())
result = now.day()
print("Current day: " + result.toString())
result = now.hour()
print("Current hour: " + result.toString())
result = now.minute()
print("Current minute: " + result.toString())
result = now.second()
print("Current second: " + result.toString())
// Test 4: Date arithmetic
result = now.addDays(7)
print("7 days from now: " + result.toString())
result = now.addHours(24)
print("24 hours from now: " + result.toString())
print("✅ DateTimeBox Phase 3 tests completed!")