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

AdminUI: DatetimePickerComponent cannot be set anywhere over 10 yrs #425

Closed
chladog opened this issue Jul 31, 2020 · 2 comments
Closed

AdminUI: DatetimePickerComponent cannot be set anywhere over 10 yrs #425

chladog opened this issue Jul 31, 2020 · 2 comments
Assignees
Labels
type: bug 🐛 Something isn't working
Milestone

Comments

@chladog
Copy link
Contributor

chladog commented Jul 31, 2020

Describe the bug
Even though we are able to set "datetime" custom field without "min" parameter, the UI component is hardcoded to allow date just 10 years before and after current year.
As far as I saw DatetimePickerComponent has just default value of "@input() yearRange = 10;" min and max paramters for custom field aren't reflected in this @input.

To Reproduce
Steps to reproduce the behavior:

  1. Create "datetime" custom field with min: null, or some date long time in history e.g. 1500.
  2. In Admin UI try to set any date before year 2010 (e.g. 1.1.2001) - it won't let you, and there is no mechanism to set the allowed date range of UI component.

Expected behavior
The UI component either reflects the "min" and "max" parameters in the allowed-to-set year range of dates, or there is a way to set yearRange in custom field configuration.

@chladog
Copy link
Contributor Author

chladog commented Sep 7, 2020

This was just partially fixed. We are now able to input the older date by clicking previous month enough of times, howerever in select box of "Year" the oldest is still 2010.

@michaelbromley
Copy link
Member

Hi,
I cannot reproduce this. Given the following custom fields config:

   customFields: {
        Customer: [{ name: 'birthday', type: 'datetime', min: '1983-09-29T00:00:00Z' }],
    },

I get a UI component like this:
issue-425-ui

If you are compiling a custom Admin UI with ui extensions, you need to delete and re-compile your admin ui as per https://www.vendure.io/docs/developer-guide/updating-vendure/#admin-ui-changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants