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

Datagrid/Validation: Date Validation on the Datagrid not working the same as fields #4730

Closed
marknolaninfor opened this issue Jan 7, 2021 · 2 comments · Fixed by #4785
Closed
Assignees
Labels
team: pathway For Pathway issues type: bug 🐛 [3] Velocity rating (Fibonacci)

Comments

@marknolaninfor
Copy link
Collaborator

Describe the bug
The validate cell function within the datagrid passes the grid information that contains information about the column's setting, eg disabled dates. This is not used by the built in validation rules of date, or availableDate, and the format and other settings are not used in the rules.

The date rule is unable to parse the date using the sourceFormat, or dateFormat used on the grid and will fallback to the short format for the locale, and this may or may not work.

The availableDate rule does not work as the datePicker options are not extracted from the passed gridInfo.column.editorOptions.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'http://localhost:4000/components/datagrid/test-datepicker-dynamic-disabled-dates.html'
  2. Enter by typing '11/11/1111'
  3. Open the date picker to see that the date is disables but no error was shown

Expected behavior
The standard validations work in the same way if they are either a field or within a datagrid.

Version

  • ids-enterprise: master

Platform

  • Infor Application/Team Name: Pathway
  • OS Version: Windows 10
  • Browser Name: chrome

Additional context
Add any other context about the problem here.

@marknolaninfor
Copy link
Collaborator Author

Example to use the gridInfo for the date rule.

// date: Validate date, datetime (24hr or 12hr am/pm)
  date: {
    check(value, field, gridInfo) {

....

      let dtApi = null;
      if (field && field.data('datepicker')) {
        dtApi = field.data('datepicker');
        dateFormat = dtApi.pattern;
      }
  	if (gridInfo && gridInfo.column) {
        const col = gridInfo.column;

        if (typeof col.sourceFormat === 'string') {
          dateFormat = gridInfo.column.sourceFormat;
        } else if (typeof col.dateFormat === 'string') {
          dateFormat = gridInfo.column.dateFormat;
        }
      }

@tmcconechy tmcconechy added [3] Velocity rating (Fibonacci) team: pathway For Pathway issues type: bug 🐛 labels Jan 7, 2021
@tmcconechy tmcconechy changed the title Date Validation on the Datagrid Datagrid/Validation: Date Validation on the Datagrid not working the same as fields Jan 7, 2021
@tmcconechy tmcconechy added this to To do in Enterprise 4.37.x (Jan 2021) Sprint via automation Jan 28, 2021
@tmcconechy tmcconechy moved this from To do to In progress in Enterprise 4.37.x (Jan 2021) Sprint Jan 28, 2021
@tmcconechy tmcconechy moved this from In progress to Pending Review in Enterprise 4.37.x (Jan 2021) Sprint Jan 29, 2021
@tmcconechy tmcconechy moved this from Pending Review to Ready for QA (beta) in Enterprise 4.37.x (Jan 2021) Sprint Feb 1, 2021
@jbrcna
Copy link
Contributor

jbrcna commented Feb 2, 2021

@jbrcna jbrcna moved this from Ready for QA (beta) to Done in Enterprise 4.37.x (Jan 2021) Sprint Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: pathway For Pathway issues type: bug 🐛 [3] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants