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

data-role="calendarpicker" creation error #1732

Closed
TorakikiSan opened this issue Mar 1, 2021 · 3 comments
Closed

data-role="calendarpicker" creation error #1732

TorakikiSan opened this issue Mar 1, 2021 · 3 comments

Comments

@TorakikiSan
Copy link

Hi Olton!

In JS console (Firefox) if a data-role="calendarpicker" field is present, I get this error:

Metro 4 - v4.5.0. Built at: 23/02/2021 19:05:17 metro.js:7377:25
m4q - v1.0.10. Built at 08/01/2021 14:20:31 metro.js:7378:25
Error creating component calendarpicker for  
<input id="DATA_COMPILED" class="input-small" name="data_compiled" data-role="calendarpicker" data-cls-calendar-header="bg-crimson" data-cls-calendar="compact" data-clear-button="true" data-validate="required" data-format="%d/%m/%Y" data-input-format="%d/%m/%Y" data-cls-input="text-bold text-center" data-label="Compiled" data-cls-label="text-bold fg-crimson" value="31/12/2020" data-role-calendarpicker="true" type="text" autocomplete="off" readonly="true">
metro.js:7585:42
Uncaught Error: Invalid date
    g metro.js:92
    v metro.js:81
    from metro.js:763
    _createStructure metro.js:12552
    _create metro.js:12511
    _createExec metro.js:7784
    _super metro.js:7734
    init metro.js:12496
    e/t.fn[i]/< metro.js:7599
    each metro.js:3827
    each metro.js:3826
    each metro.js:3841
    i metro.js:7598
    initWidgets metro.js:7564
    initWidgets metro.js:7557
    each metro.js:3827
    each metro.js:3826
    initWidgets metro.js:7548
    init metro.js:7502
    <anonymous> metro.js:7897
metro.js:92:18

Can help me?

Thank's!

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The author has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/olton/Metro-UI-CSS or Patreon

olton added a commit that referenced this issue Mar 2, 2021
olton added a commit that referenced this issue Mar 2, 2021
@olton
Copy link
Owner

olton commented Mar 2, 2021

Thank you for a report, I fixed this bug. Please check it.

@olton
Copy link
Owner

olton commented Mar 2, 2021

https://codepen.io/olton/pen/dyOePPR?editors=1000
Important! I change the date format parser. Now you must use:

<input id="DATA_COMPILED"
               class="input-small"
               name="data_compiled"
               data-role="calendarpicker"
               data-cls-calendar-header="bg-crimson"
               data-cls-calendar="compact"
               data-clear-button="true"
               data-validate="required"
               data-cls-input="text-bold text-center"
               data-label="Compiled"
               data-cls-label="text-bold fg-crimson"
               type="text"
               autocomplete="off"
               readonly

               data-value="31/12/2020"
               data-format="DD/MM/YYYY"
               data-input-format="DD/MM/YYYY"

        >

@olton olton closed this as completed Aug 1, 2021
olton added a commit that referenced this issue Oct 28, 2023
olton added a commit that referenced this issue Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants