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

Refactor ScopeBuilder date picker #1463

Merged
merged 7 commits into from
Oct 4, 2020

Conversation

ibelar
Copy link
Contributor

@ibelar ibelar commented Sep 30, 2020

  • Create atk-date-picker component wrapper for v-date-picker;

  • Allow customizing date picker in the query builder via v-date-picker props.

Example: Starting calendar on a Monday by setting the first-day-of-week option and changing language

    public $datePickerProps = [
        'locale' => 'fr-Fr',
        'masks' => ['input' => 'YYYY-MM-DD'],
        'first-day-of-week' => 2
    ];

Screen Shot 2020-09-30 at 10 59 14 AM

@ibelar ibelar added the RTM label Sep 30, 2020
js/src/atk-utils.js Outdated Show resolved Hide resolved
@ibelar ibelar requested a review from mvorisek October 2, 2020 12:42
@DarkSide666 DarkSide666 self-requested a review October 4, 2020 18:41
Copy link
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we set 'masks' => ['input' => 'DD-MM-YYYY'] or phpDateFormat = 'd-m-Y'?
Are these related to that regex and if yes then it will probably fail.

Besides that LGTM.

@ibelar
Copy link
Contributor Author

ibelar commented Oct 4, 2020

What if we set 'masks' => ['input' => 'DD-MM-YYYY'] or phpDateFormat = 'd-m-Y'?
Are these related to that regex and if yes then it will probably fail.

'masks' => ['input' => 'DD-MM-YYYY'] is for how v-date-picker will display date inside the input to user, while phpDateFormat = 'd-m-Y' is the format that will be set in query. They are are not regex related. This is another reason why I want to switch to flatpickr (see #1467 ) Flatpickr use PHP date format so no need to translate.

@ibelar ibelar merged commit 4cda19a into develop Oct 4, 2020
@ibelar ibelar deleted the feature/query-builder-date-picker-options branch October 4, 2020 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants