Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow date input to setup a custom formattedValue #6930

Closed
1 task done
ritxi opened this issue Sep 3, 2024 · 2 comments · Fixed by #7040
Closed
1 task done

Allow date input to setup a custom formattedValue #6930

ritxi opened this issue Sep 3, 2024 · 2 comments · Fixed by #7040

Comments

@ritxi
Copy link

ritxi commented Sep 3, 2024

Description

As a developer using Carbon I want to be able to define a custom formattedValue for date-input/date-range. The application I'm working on allows to setup prefered date format. It would be nice to be able pass this format to the date-input/date-range.

Suggested solution

Add a prop to overide default smart behaviour based on locale.

const [state, setState] = useState("04/04/2019");
  const setValue = (ev: DateChangeEvent) => {
    setState(ev.target.value.formattedValue); // 04-04-2019
  };
  return <DateInput label="Date" name="date-input" value={state} onChange={setValue} customFormat="DD-MM-yyyy" />;

Demo URL

No response

Alternatives

No response

Additional context

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@ritxi ritxi added Enhancement triage Triage Required labels Sep 3, 2024
@nineteen88
Copy link
Contributor

FE-6797

@nineteen88 nineteen88 added On Backlog Squad SBC Payroll and removed triage Triage Required labels Sep 10, 2024
damienrobson-sage added a commit that referenced this issue Oct 30, 2024
… override the format of dates

A new property has been added to the locale interface for dates to allow customers to override the
displayed date formats in both the Date and DateRange inputs

fix #6930
damienrobson-sage added a commit that referenced this issue Oct 31, 2024
… override the format of dates

A new property has been added to the locale interface for dates to allow customers to override the
displayed date formats in both the Date and DateRange inputs

fix #6930
damienrobson-sage added a commit that referenced this issue Oct 31, 2024
… override the format of dates

A new property has been added to the locale interface for dates to allow customers to override the
displayed date formats in both the Date and DateRange inputs

fix #6930
damienrobson-sage added a commit that referenced this issue Nov 4, 2024
… override the format of dates

A new property has been added to the locale interface for dates to allow customers to override the
displayed date formats in both the Date and DateRange inputs

fix #6930
damienrobson-sage added a commit that referenced this issue Nov 5, 2024
… override the format of dates

A new property has been added to the locale interface for dates to allow customers to override the
displayed date formats in both the Date and DateRange inputs

fix #6930
damienrobson-sage added a commit that referenced this issue Nov 6, 2024
… override the format of dates

A new property has been added to the locale interface for dates to allow customers to override the
displayed date formats in both the Date and DateRange inputs

fix #6930
carbonci pushed a commit that referenced this issue Nov 8, 2024
## [144.6.0](v144.5.0...v144.6.0) (2024-11-08)

### Features

* **date, date-range:** provides a mechanism that allows consumers to override the format of dates ([aed6c43](aed6c43)), closes [#6930](#6930)
@carbonci
Copy link
Collaborator

carbonci commented Nov 8, 2024

🎉 This issue has been resolved in version 144.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants