Repository navigation
Conversation
… #579): a text or LocalDateTime timestamp set on a user time zone field is read in the input time zone (it was read in the system time zone), and a javascript Date set on a timestamp field is taken as the instant it is (it took the browser's wall clock as system time zone time). fieldCalculation.min.js regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…fields are passed in the system time zone also without convert_timezone. Signup then loads them with ?tz=<site time zone>, so they arrived as site wall clock times and the field calculation, which reads timestamps in the system time zone, was off by the site's offset (system UTC, site Europe/Vienna: 08:00 Vienna was taken as 08:00 UTC and shown as 10:00). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion are kept in the system time zone, so an unchanged user time zone timestamp is no longer marked as changed (ZonedDateTime.equals compares the zone). fieldCalculation.min.js regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ports the field calculation time zone fixes of phoenixctms/ctsms#579 to the Signup copy of
fieldCalculation.jsand regeneratesfieldCalculation.min.js(minify.pl).LocalDateTimevalue set on a timestamp field with "user time zone" is read in the input time zone (the site's time zone), not the system time zone. Example: system UTC, site Europe/Vienna, a calculation sets"01.05.2026 10:00": it was taken as 10:00 UTC (shown as 12:00 Vienna), now it is 10:00 Vienna.Dateset on a timestamp field is taken as the instant it is. Before, the browser's local wall clock was taken as system time zone time: browser Vienna, system UTC,new Date()at 10:00Z became 12:00Z.The changed lines are the same as in the ctsms web copy.
Also: without
convert_timezone(the default), the inquiry page passed values of user time zone timestamp fields to the field calculation as site wall clock times (Signup loads them with?tz=<site time zone>), while the field calculation reads timestamps in the system time zone. System UTC, site Europe/Vienna: a value of 08:00 Vienna was taken as 08:00 UTC and shown as 10:00.datetime_ui_to_json(used only for these JS rows) now converts user time zone values from the site time zone to the system time zone in both modes. Saving (datetime_ui_to_iso) is unchanged, since ctsms converts bytzthere. Otherwise Signup already sends date and time field values as system time zone strings, and ctsms#579 now reads them in the system time zone also with?tz=(before, each save moved them by the site's offset). The same applies to the eCRF/inquiry importers with atimezonesetting.Tested:
Dateconversion with the same js-joda build in Nashorn (JVM zone Europe/Vienna): 10:00Z stays 10:00Z, the old code gave 12:00Z. The minified file contains both changes.tz=Europe/Viennaas 08:00 is stored as 06:00 UTC and returned in the page values as2026-05-01 08:00:00. Signup'sdatetime_iso_to_ui+datetime_ui_to_jsonwith a Vienna site turn it into2026-05-01 06:00(before:08:00) withconvert_timezoneoff and on; fields without user time zone are unchanged.system_timezoneUTC like ctsms there, site time zone Europe/Vienna,convert_timezoneoff): registered a proband (birth date 01.05.1990 stored as 1990-05-01), opened a trial questionnaire with a user time zone timestamp inquirytsu(value 08:00 Vienna = 06:00 UTC) and a text inquiry calculated byfunction(tsu) { return tsu.toString(); }. Applying the calculated value gives2026-05-01T06:00Z[UTC]; with the previousUtils.pmit gave2026-05-01T08:00Z[UTC]. Changing the time to 09:00 in the form and saving stored 07:00 UTC.Needs phoenixctms/ctsms#579.
🤖 Generated with Claude Code
Summary by CodeRabbit