PolicyEngine / policyengine-app

PolicyEngine's free web app for computing the impact of public policy.
GNU Affero General Public License v3.0
32 stars 86 forks source link

Shorten and improve policy editor dates #1679

Closed anth-volk closed 5 days ago

anth-volk commented 2 weeks ago

At the moment, the portion of the left-hand bar that lists what changes a reform contains and when they occur utilizes British date formatting for all app versions, including the US and Canada, where "month day, year" format is the standard.

MaxGhenis commented 2 weeks ago

How about returning to YYYY-MM-DD format? This will also let us fit it on one line if we shrink the font size a bit (like we had before and which I think gave some useful visual distinction from the parameter value change, along with lighter font shade)

image

We could also remove the from, just

2024-01-01 to 2025-12-31

or if they're year-starting and -ending dates, just

2024 to 2025

or

2024-25

anth-volk commented 2 weeks ago

A good compromise may be using Intl.DateTimeFormat to print a short date? E.g., from Jan. 1, 2024 to Dec. 31, 2024 for US and from 1 Jan. 2024 to 31 Dec. 2024 for UK. I believe @nikhilwoodruff was a strong proponent of the long-form date, and at the very least, as much as I love YYYY-MM-DD, it can feel a bit overly technical, in my opinion - perhaps our more dev-oriented users would appreciate it, but I can imagine those wanting to abstract away the tougher technical details might not.

I will say that my open PR for #1261 does address this a bit, and whatever changes we utilize could be wrapped into that, if preferred.

MaxGhenis commented 2 weeks ago

OK how about removing the dates for complete years?

anth-volk commented 2 weeks ago

Let me send some screenshots along later today.

anth-volk commented 2 weeks ago

Here are a couple of alternatives:

Full-size standard date for US and UK: Very similar to what we have now https://github.com/PolicyEngine/policyengine-app/assets/14987227/05de8e53-59df-42ca-9a91-335c7c80c0e7

Medium standard date: Has the advantage of fitting easily on one line, but a bit less formal https://github.com/PolicyEngine/policyengine-app/assets/14987227/c211ad92-4599-4085-9f34-cb513802e3cf

I skipped the short form. That's "5/2/2024" for the US, "2/5/2024" for the UK, and I don't think any of us would want to use that.

YYYY-MM-DD can also be returned to, but I haven't bothered modelling it, since it's the past default. In all cases, we could shorten to years only when that's relevant and/or drop the font size if we want the full date displayed. I'm not as big a fan of "2024-25", but that's my only personal viewpoint.

MaxGhenis commented 2 weeks ago

Can you say more on what you dislike about "2024-25" or "2024 to 2025" or "from 2024 to 2025"?

anth-volk commented 1 week ago

I don't think "2024-25" fits as well within the redesigned UI as either "2024 to 2025" or "from 2024 to 2025." I think the other two are fine, but my preference would be "2024 to 2025".

Incidentally, what if a user selects only 2024? Is "2024" sufficient? Or should there be some added qualifying statement, like "throughout 2024"?

MaxGhenis commented 1 week ago

I think if it's "2024 to 2025" with multiple years, just "2024" suffices for one year

anth-volk commented 1 week ago

1261 was merged, and as that PR does localize the policy editor dates, renaming this issue to something more appropriate