localization-procs.tcl

  • last updated 16 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Bring the logics to parse a datetime from lc_time_fmt into an own private utility lc_datetime_to_clock and reuse it also when we convert from one timezone to another

Allow also dates in the "short" time format, as they may be supplied to the api in such form e.g. by the calendar package

Fixes lang_test__lc_procs automated test

Go ahead and reimplement also lc_time_utc_to_local

  1. … 2 more files in changeset.
Reimplement lc_time_local_to_utc using lc_time_tz_convert

  1. … 2 more files in changeset.
lc_time_tz_convert reform:

- enforce that only dates in the ISO format "%Y-%m-%d %H:%M:%S" are accepted

- apply clock api normalization to seemingly out of range time_values, as per https://www.tcl.tk/man/tcl/TclCmd/clock.html#M25

- return the empty string every time input is invalid or a conversion cannot be determined

- return a value, as ISO date, only when conversion is successful

- prefer the clock api to perform the conversion, but fall back to the ref-timezones datamodel when the timezone is not supported by Tcl

  1. … 2 more files in changeset.
improved error message

bring test coverage to >50% by adding test cases and marking only locally called functions as private

  1. … 2 more files in changeset.
prefer "ns_conn isconnected" over "ad_conn isconnected", since the latter might not notice changes in the connect state

  1. … 18 more files in changeset.
mprove spelling: move closer to the linux documentation recommendations

  1. … 21 more files in changeset.
use dot instead of colon as separator between package name and cache key to ease readability

  1. … 10 more files in changeset.
acs::per_thread_cache: standardize per-thread caching

- added per-thread cache based on namespaced Tcl variables.

- use per-thread-cache on several occasions

- bump version number of acs-tcl to 5.10.0d34

  1. … 14 more files in changeset.
Fix typo

Doc formatting changes

Keep supporting previously undocumented use cases for lc_time_fmt:

- database timestamps e.g. "2019-12-16 12:58:10.370124+01"

- short timestamps without seconds e.g. "2019-12-16 12:58"

Improved documentation and extended test cases

  1. … 1 more file in changeset.
Address lc_time_fmt shortcomings:

- use clock scan to enforce supported date formats, 'YYYY-MM-DD' (undocumented, but explicitly checked for in the code) and 'YYYY-MM-DD HH:MM:SS'

- leverage clock scan capabilities to correctly handle 'impossible dates' such as 1999-02-29

- leverage clock format to obtain the correct week day

- leverage clock api to correctly handle gregorian/julian dates

- implement documented formats that had an empty entry in format array (%W, u, %U, %j)

  1. … 1 more file in changeset.
Rename clock_to_ansi to lc_clock_to_ansi to comply with naming convention, replace occurrences, create deprecated wrapper

  1. … 5 more files in changeset.
improve spelling

  1. … 11 more files in changeset.
Prefer '==' over 'eq' on numeric comparison

lc_content_size_pretty: go the extra mile and return a localized 'byte' when the result is just 1 byte. Bump acs-lang version to reload message keys.

  1. … 34 more files in changeset.
Move 'util::content_size_pretty' into 'acs-lang' and rename it to 'lc_content_size_pretty', localicing 'bytes' and adapting automated tests. Bump 'acs-lang' version.

  1. … 41 more files in changeset.
Bring files on oacs-5-10 in sync with HEAD

  1. … 15 more files in changeset.
Fix typo in proc doc

improve spelling

  1. … 15 more files in changeset.
scalability improvement: keep result of lc_time_fmt_compile in (lock-free) per-thread cache rather than in the util_memoize cache

whitespace cleanup

  1. … 9 more files in changeset.
Use "ad_try" instead of "with_catch"

  1. … 4 more files in changeset.
merged changes from the oacs-5-9 branch and resolved conflicts

  1. … 7834 more files in changeset.
Fix spelling errors

  1. … 8 more files in changeset.
Fix spelling errors

  1. … 48 more files in changeset.
- use util::trim_leading_zeros instead of private function

  1. … 1 more file in changeset.