Custom Form -> Day Component -> Day -> Day First => Breakage

10 views
Skip to first unread message

Shai Berger

unread,
Oct 8, 2025, 1:18:57 PM (5 days ago) Oct 8
to xnat_discussion
Hi,

Having used XNAT in trivial ways so far, I am now trying to configure one for real use, and I've been playing with Custom Forms. I ran into a problem, which I don't see previously mentioned:

The Day Component of custom forms (a date field) has, in its configuration, a "Day" tab, and in it a checkbox named "Day First", which, when checked, makes the field show the day part of the date first. This applies both to the controls (the month selection box goes to the middle), and to the displayed date (i.e. September 27, 2025 becomes "27/09/2025"). This is the way I'd prefer things.

There's two problems with this. The first and smaller one is, that this checkbox can be set only per-field -- I haven't seen any way to set it globally, and since this is basically a locale thing, that is just a nuisance. I think that is a UI-design bug, but it's minor.

The bigger problem is that the displayed date ("27/09/2025" above) is also what gets saved, and what the system tries to use against the database. The database has its datestyle set to "ISO, MDY" (I'm not even sure if that was the default or XNAT's initialization, but that's what it is), so this value causes a "date value out of range" error in Postgres. Thus, I can't use the feature at all.

Am I missing something obvious?
I'm running XNAT 1.9.2.2 on Ubuntu 22.04, Postgres client v. 14, OpenJDK-8 from Ubuntu, Tomcat 9 from Ubuntu; Postgres server 17 (managed, Digital Ocean).

Thanks,
Shai.

Mohana Ramaratnam

unread,
Oct 9, 2025, 4:45:25 AM (5 days ago) Oct 9
to xnat_di...@googlegroups.com
Hi Shai,

How are you using the date once it's saved? With respect to saving the date from custom form, entire form data is saved into a JSON field and the specifics of the date format are hence ignored. 

Regards,
Mohana Ramaratnam,

 moh...@xnatworks.io
 xnatworks.io | Find us on LinkedIn


--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xnat_discussion/609c23d5-fe9b-4e5d-a510-020a5790fe62n%40googlegroups.com.

Shai Berger

unread,
Oct 9, 2025, 9:30:03 AM (4 days ago) Oct 9
to xnat_di...@googlegroups.com
Hi Mohana,

I was just trying to add the column to a search -- and it broke the search (the search functionality, it seems, tries to create a temporary table where Day components are made into Date columns).

Thanks for looking into this!

You received this message because you are subscribed to a topic in the Google Groups "xnat_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xnat_discussion/W7oQ-VjVqB0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xnat_discussi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xnat_discussion/CAHPNensuqjn%3DRvYwnxsqRXJWZPe7UMf%3DbiAiCC4mcjGpP6%2BTvA%40mail.gmail.com.


--

Mohana Ramaratnam

unread,
Oct 9, 2025, 10:08:43 AM (4 days ago) Oct 9
to xnat_di...@googlegroups.com
Hi Shai,

I can replicate your issue. We have created a ticket to track this issue. 

Regards,
Mohana Ramaratnam,

 moh...@xnatworks.io
 xnatworks.io | Find us on LinkedIn

Shai Berger

unread,
Oct 9, 2025, 12:53:57 PM (4 days ago) Oct 9
to xnat_di...@googlegroups.com
Thanks!

I wanted to start watching the issue and maybe add a comment, but it seems the account I created on your Jira is somehow broken and cannot do this.



--

Will Horton

unread,
Oct 9, 2025, 5:40:43 PM (4 days ago) Oct 9
to xnat_discussion
Shai, I'm attempting to triage this but I can't locate your user account. Please feel free to email me directly with your username and I can escalate. 

Regards,
Will 

Mohana Ramaratnam

unread,
Oct 10, 2025, 5:14:48 AM (4 days ago) Oct 10
to xnat_di...@googlegroups.com
Hello Shai,

We have a fix for XNAT-8532 (issue with day first setting on a form not displaying as a search column). 

I will share a war file with you for you to test. I will let you know once the upload is complete. 

Few points:

There are multiple places where dates are displayed in XNAT. These are:

a) On a report page of a Subject or Experiment
b) Via a form (like you are doing)
c) On a Search listing. 

In order to change the display of dates in case of a) above, use the Administer -> Site Administration -> Appearance to set the date format to dd-mm-yyyy. 

Screenshot 2025-10-10 at 2.40.29 PM.png

This will result in a display like for a) and b) (the case when custom form dayFirst enabled):

Screenshot 2025-10-10 at 2.39.07 PM.png
However, the search listings would display all dates as YYYY-MM-DD like

Screenshot 2025-10-10 at 2.41.58 PM.png

Regards,
Mohana Ramaratnam,

 moh...@xnatworks.io
 xnatworks.io | Find us on LinkedIn

Reply all
Reply to author
Forward
0 new messages