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

Date picker formatting: Custom date-format breaks component usage #9743

Closed
2 tasks done
lyyka opened this issue Sep 11, 2022 · 1 comment
Closed
2 tasks done

Date picker formatting: Custom date-format breaks component usage #9743

lyyka opened this issue Sep 11, 2022 · 1 comment

Comments

@lyyka
Copy link

lyyka commented Sep 11, 2022

Description

What I expected:
When I define date-format (i.e. "d/m/Y") on bx-date-picker component, I expect the component to render the value in that format, but still work with 'Y-m-d' format in the back. So when loading existing values, I wanted to load the value in Y-m-d format and set enabled-range in Y-m-d format too.

What happened instead:
I defined date-format as "d/m/Y". enabled-range which was defined in Y-m-d format was no longer working and value was no longer loading correctly. Defining enabled-range in new "d/m/Y" format breaks it, as the "/" is used as delimiter between min/max dates.

Component(s) impacted

bx-date-picker/ bx-date-picker-input

This is my code, trying to use "d/m/Y" format (not working as expected atm):

<bx-date-picker date-format="d/m/Y"
                enabled-range="/{{ now()->subYears(21)->format('d/m/Y') }}"
                class="form-field"
                name="date_of_birth">
    <bx-date-picker-input label-text="* Date of birth"
                          kind="single"
                          value="{{ $user->date_of_birth?->format('d/m/Y') }}"
                          @error('date_of_birth') invalid validity-message="{{ $message }}" @enderror
                          placeholder="dd/mm/yyyy">
    </bx-date-picker-input>
</bx-date-picker>

Browser

Chrome

Carbon Web Components version

latest (https://1.www.s81c.com/common/carbon/web-components/tag/latest/date-picker.min.js)

Severity

Severity 1 = The design is broken in a critical way that blocks users from completing tasks or damages the brand. Affects major functionality, no workaround.

Application/website

Laravel application

CodeSandbox example

?

Steps to reproduce the issue (if applicable)

Already explained in description

Release date (if applicable)

No response

Code of Conduct

@lyyka lyyka added the bug Something isn't working label Sep 11, 2022
@kennylam kennylam transferred this issue from carbon-design-system/carbon-web-components Dec 6, 2022
@stale
Copy link

stale bot commented May 27, 2023

We've marked this issue as stale because there hasn't been any activity for 60 days. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@stale stale bot added the inactive label May 27, 2023
@andy-blum andy-blum closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

6 participants