_acs-datetime__dt_early_years (private)
_acs-datetime__dt_early_years
Defined in packages/acs-datetime/tcl/test/date-construction-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ foreach year {0001 0009 0099 0999 1000 2000} { foreach month {01 02 08 09 12} { set iso $year-$month-14 set seconds [clock scan $iso -format %Y-%m-%d] set julian [clock format $seconds -format %J] set info [dt_get_info -dict $iso] aa_equals "$iso Julian day" [dict get $info julian_date_today] $julian aa_equals "$iso year" [dict get $info year] $year aa_equals "$iso beginning of year" [dict get $info beginning_of_year] $year-01-01 set first [clock scan $year-$month-01 -format %Y-%m-%d] aa_equals "$iso weekday" [dict get $info first_day_of_month] [expr {[clock format $first -format %w] + 1}] foreach {key delta} {next_month 1 prev_month -1} { aa_equals "$iso $key" [dict get $info $key] [clock format [clock add $first $delta month] -format %Y-%m-%d] } aa_equals "$iso month length" [dict get $info num_days_in_month] [clock format [clock add [clock add $first 1 month] -1 day] -format %d] set start [dict get $info first_julian_date_of_month] set weekday [dict get $info first_day_of_month] set length [dict get $info num_days_in_month] aa_equals "$iso first Julian day" $start [clock format $first -format %J] aa_equals "$iso grid start" [dict get $info first_julian_date] [expr {$start + 1 - $weekday}] aa_equals "$iso last month day" [dict get $info last_day] $length aa_equals "$iso last Julian day in month" [dict get $info last_julian_date_in_month] [expr {$start + $length - 1}] aa_equals "$iso grid end" [dict get $info last_julian_date] [expr {$start + $length - 1 + (7 - (($length + $weekday - 1) % 7)) % 7}] aa_equals "$iso preceding month length" [dict get $info days_in_last_month] [clock format [clock add $first -1 day] -format %d] aa_equals "$iso first displayed day" [dict get $info first_day] [expr {[dict get $info days_in_last_month] + 2 - $weekday}] aa_equals "$iso month name" [dict get $info month] [lc_time_fmt $iso %B] aa_equals "$iso next month name" [dict get $info next_month_name] [lc_time_fmt [dict get $info next_month] %B] aa_equals "$iso previous month name" [dict get $info prev_month_name] [lc_time_fmt [dict get $info prev_month] %B] lassign [dt_ansi_to_list "$iso 08:09:01"] y m d h mi s scan $year %d expected_year aa_equals "$iso datetime year" $y $expected_year aa_equals "$iso datetime time" [list $h $mi $s] {8 9 1} # Exercise the caller-variable interface used by older widgets too. dt_get_info $iso aa_equals "$iso caller Julian day" $julian_date_today $julian } } aa_equals "unpadded year" [dt_ansi_to_julian 999 9 14] [dt_ansi_to_julian 0999 09 14] }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "dt_early_years (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle