patternfly / patternfly/patternfly-react

DatePicker: specify time zone for today's date (current)

Open
#11,273 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale
Dominant language
TypeScript
Stars
862
Forks
392
Avg merge
4d 8h
Merged PRs (30d)
9

Description

Describe the enhancement or change

We propose adding a property to the DatePicker (and CalendarMonth) components to specify the time zone to be applied when determining today's date.

Details
In our application, users can specify the time zone they are working in.

For instance, a user located in the PST time zone may collaborate with users in the UK and choose to use the UTC time zone within the application.
If the user sets the time zone to UTC (01:02, 21 November), the application may still highlight the 20th because it reflects the local date based on the user's computer settings rather than the selected UTC time zone (17:02, 20 November).

Image

When the user changes their computer’s clock to UTC, then the today's date is updated to the 21st as expected.

Image

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?
No

Any other information?

Link to hardcoded today's date: https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/CalendarMonth/CalendarMonth.tsx#L122

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at packages/react-core/src/components/CalendarMonth/CalendarMonth.tsx around the hardcoded today's date, then trace how DatePicker and CalendarMonth determine the current day. Define the time-zone property behavior from the issue's UTC example and verify that highlighting today's date follows the selected time zone rather than the computer's local setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.