chrisdavies / tiny-date-picker

A small, modern, dependency-free date picker
https://chrisdavies.github.io/tiny-date-picker/
415 stars 87 forks source link

API completed #43

Closed taomatico closed 7 years ago

taomatico commented 7 years ago

In order to use the new dp-permanent mode the API has been updated with the next improvements:

Methods:

Events:

Furthermore, an issue have been corrected:

I hope you like it.

Best regards.

chrisdavies commented 7 years ago

Hm. Sorry I've been slow in responding.

There is currently a setValue. I haven't tried it with the new "permanent" mode, but I'd expect that to do what direct does. So, I think we shouldn't need direct. Also, if we have setValue, I'm not sure if we need goMonths or goYear, either. Thoughts?

I do like the code cleanup in this pull request.

I don't think we should check in those XML files, though.

taomatico commented 7 years ago

Hi Chris,

If I am not wrong, the current setValue method selects a date as if a click have been pressed over a day in the UI calendar. With the new go and next methods the expected behaviour are different as what is tried is browsing the UI via API without changing the selectedDate value. The goal is to be able of move the UI calendar as if a user clicked the next, prev and month/year panels, this action only changes the currentDate value.

onSelect method is dispatched every time currentDate is changed, maybe its confusing but we already have onSelectMont and onSelectYear and I would like to respect the naming.

This functionality is usefull when you want to, for example, sincronize the calendar with the scroll movement, with another selectors in other side of the site.

Furthermore, maybe go and direct methods are redundant, but I think it can ease the integration for next and prev virtual actions.

Best regards

taomatico commented 7 years ago

I'm sorry for those xml files, I didnt be carefull when uploading the changes. : /

chrisdavies commented 7 years ago

Ah. I see what you mean. I've been trying pretty hard to keep the API footprint to a minimum, but this is a relatively small change and I can see the utility of it.

I'll have a look over it soon and we'll see about getting it in. Thanks!

On Mon, Jul 10, 2017 at 3:52 AM, mcnach notifications@github.com wrote:

I'm sorry for those xml files, I didnt be carefull when uploading the changes. : /

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrisdavies/tiny-date-picker/pull/43#issuecomment-314031924, or mute the thread https://github.com/notifications/unsubscribe-auth/AAy3YZ0LyyBr0e4hEhmwZ4bjrjonKfjzks5sMdg_gaJpZM4OPgQd .

taomatico commented 7 years ago

Hi Chris, could you check that out?

Best regards!

chrisdavies commented 7 years ago

Ah. It's on my todo list, but I haven't prioritized it.

Is this blocking something critical for you?

Thanks!

On Mon, Jul 17, 2017 at 9:07 AM, mcnach notifications@github.com wrote:

Hi Chris, could you check that out?

Best regards!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrisdavies/tiny-date-picker/pull/43#issuecomment-315750194, or mute the thread https://github.com/notifications/unsubscribe-auth/AAy3YXD_XO8-rC_z518xCyNY0zBa9owSks5sO1yLgaJpZM4OPgQd .

taomatico commented 7 years ago

Hi!

Right now I'm using my fork to compile so it's not blocking me in the short run. Anyway it will be nice to merge it in a future to configure properly my project dependences at production time.

I'm managing the calendar via API and I need to control the select and current dates with the new improvements of this branch.

If you need some help or want me to make some changes just tell me.

Best regards : )

chrisdavies commented 7 years ago

Gotcha! I'll pull it and work on it today, then.

Sorry I've been procrastinating!

-C-

On Thu, Jul 20, 2017 at 3:46 AM, mcnach notifications@github.com wrote:

Hi!

Right now I'm using my fork to compile so it's not blocking me in the short run. Anyway it will be nice to merge it in a future to configure properly my project dependences at production time.

I'm managing the calendar via API and I need to control the select and current dates with the new improvements of this branch.

If you need some help or want me to make some changes just tell me.

Best regards : )

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrisdavies/tiny-date-picker/pull/43#issuecomment-316624689, or mute the thread https://github.com/notifications/unsubscribe-auth/AAy3YVTKIYcJd0MTDnwaWGcVo2xqqAhhks5sPwXjgaJpZM4OPgQd .

taomatico commented 7 years ago

No problem. I like to say 'I'm gathering strengths' instead of procrastinating lol

Thank you so much!

chrisdavies commented 7 years ago

Hey, I merged this in a separate branch, mainly to avoid the XML files. I also renamed things a bit to (I hope) make the new methods a little more clear!

Thanks again for the contribution.

We do still need to add in integration tests for the new permanent calendar navigation API. Also, I'd like to shrink the size of this again. (It currently sits at 3KB. Running npm run min minifies and prints out the size.)

Thanks!

taomatico commented 7 years ago

Thank you so much, the new names are clearest! As soon I have time I'll try to check this test out.

Best regards!