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

datetime field not functioning #5

Closed
ckadams opened this issue Nov 8, 2015 · 7 comments
Closed

datetime field not functioning #5

ckadams opened this issue Nov 8, 2015 · 7 comments

Comments

@ckadams
Copy link

ckadams commented Nov 8, 2015

When the type is datetime, the field appears, but the datepicker does not function. Does anyone have any ideas on how to get this to function?

@mrmnml
Copy link

mrmnml commented Nov 9, 2015

I noticed the same issue. If i find a work around I'll let you know

@mrmnml
Copy link

mrmnml commented Nov 9, 2015

edit: Ok, I think this is the part that made it work, disregard the rest:

  1. on the page where you edit your content, add a few items to the date time array
  2. without editing them, save the entry
  3. reload the page
  4. datepicker works now

repeat if you want to add new items


Strange, it's working now. Don't know if you can reproduce this, but I

  1. added another regular datetime field to the content type
  2. reloaded the page
  3. opened the datepicker for the new field
  4. added & opened the datepicker for an array field type item
  5. saved (& ignored the error message because I didn't update my db)
  6. removed the new datetime field
  7. ???
  8. profit

Now it works for me.

@ckadams
Copy link
Author

ckadams commented Nov 9, 2015

Yes, If there is data, then reloading the page will allow the datepicker to load properly. However, the next field will fail again until you manually add data, save and reload. That is not an option, as it is not very usable.

An option is to include a random ID in and call the datepicker again (passing the new id) in javascript after the is visible in the DOM. I just haven't walked through the code to find out where the best place to set the ID might be. Might work, might not. I'm certain there's a simpler solution.

Thanks for your input!

@WedgeSama
Copy link
Owner

I reproduice the problem too and found were it is.

When I dev the extension, it was only to be use with "simple" type (no javascript call) and with others field type extentions where javascript code is write in template (so it is call directly when click the Add button). This is why I did not noticed it.

For base types with use of javascript, the code is located in the bolt.min.js and run only once: at page loading. So this is why it not works as expected.

I will take a closer look to find a way to make it works correctly.

@WedgeSama
Copy link
Owner

I made some fix about this issue. You can see on the README which base field types work or not. For date and datetime, it is now OK.

Can you test with the dev-master? I will create a new tag after your feedback.

@ckadams
Copy link
Author

ckadams commented Nov 14, 2015

Excellent work! I tested add, delete, update with numerous datetime fields and they appear to be functioning. Thank you very much!

@WedgeSama
Copy link
Owner

Now 1.0.3 released and solve the original problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants