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

[EAK-517] Fix date parsing for coral-datepicker element #517

Open
mhoroshko opened this issue Feb 29, 2024 · 0 comments
Open

[EAK-517] Fix date parsing for coral-datepicker element #517

mhoroshko opened this issue Feb 29, 2024 · 0 comments
Labels
javascript JavaScript code contribution

Comments

@mhoroshko
Copy link
Contributor

Preconditions: example of dialog field where fetch doesn't work

    @Child(name = "../displayDate")
    @DialogField(
            name = "../displayDate",
            label = "Publication Date"
    )
    @DatePicker(
            displayedFormat = "MMMM DD, YYYY",
            type = DatePickerType.DATETIME
    )
    @DependsOn(query = "'../displayDate'", action = DependsOnActions.FETCH)
    private Calendar displayDate;

suggestion for fix:

(function ($, DependsOn) {
    'use strict';
    DependsOn.ElementAccessors.registerAccessor({
        selector: 'coral-datepicker', 
        set: function($el, value) {
             $el.prop('value', new Date(value));
        },
    });
})(Granite.$, Granite.DependsOnPlugin);
@mhoroshko mhoroshko added the javascript JavaScript code contribution label Feb 29, 2024
@smiakchilo smiakchilo changed the title [EAK-517] fix date parsing for coral-datepicker element [EAK-517] Fix date parsing for coral-datepicker element May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript JavaScript code contribution
Projects
None yet
Development

No branches or pull requests

1 participant