Skip to content

Conversation

@emilkarl
Copy link

Based on #61 PR and @findchris work I forked and added option to include until and indefinite until.

I also updated so it works with the latest master from GetJobber.

@findchris
Copy link

Nice 👏 - This functionality definitely needs to be incorporated.

@emilkarl
Copy link
Author

emilkarl commented Oct 2, 2015

Someone should really clean upp the styles as well so it can easily be overridden. I will try to do it some day.

@emilkarl
Copy link
Author

Add possibility to disable outerCancel

$.fn.recurring_select.options = {
  monthly: {
    show_week: [true, true, true, true, false, false]
  },
  until: true,
  indefinite_until: true,
  datepicker: {
    firstDay: 1  # 1 = monday, 0 = sunday
  },
  close_on_outside_click: true
}

@emilkarl
Copy link
Author

emilkarl commented Feb 8, 2016

Added ability to set the beforeShowDay function on the datepicker

@nfedyashev
Copy link

@emilkarl thanks a lot!

@btc
Copy link

btc commented Jun 9, 2016

@emilkarl @findchris

The rule summary text/feature is malfunctioning. Note, in the image below, that the day and month are mixed up.

pasted_image_6_8_16__6_19_pm

temporary fix:

I dug around in the code for a bit and started to understand and began to devise a fix when discovered that I could address the issue in user land with the following in config/initializers/recurring_select.rb

RecurringSelect.date_format = '%m/%d/%Y'

This patches the issue, but does not address the root cause. I am hoping that someone more familiar with the gem can determine which of IceCube, RecurringSelect, and the date picker ought to dictate the format of the until string (I suppose IceCube), and where the fix ought to be implemented.

The default RecurringSelect.date_format is '%Y-%m-%d' (yyyy-mm-dd), but the form value arrives on the server as %d/%m/%Y (dd/mm/yyyy). It seems that the date picker is not respecting the date format.

Please note:

(byebug) hash[:until]
"06/15/2016"
(byebug) IceCube::TimeUtil.deserialize_time '06/15/2016'
*** ArgumentError Exception: argument out of range

nil
(byebug) IceCube::TimeUtil.deserialize_time '15/06/2016'
2016-06-15 00:00:00 -0700

@emilkarl
Copy link
Author

emilkarl commented Jun 9, 2016

Interesting @briantigerchow, might have something to do the datepicker_format. I haven't seen this before but as you can see the default datepicker_format is Y-m-d here: https://github.com/GetJobber/recurring_select/pull/96/files#diff-259648c56ceac4822cff1057c8c1ee9eL5

I dont have time to look at it right away.

the month and day get mixed up because of the way that Time.zone.parse
interprets the input string
@btc
Copy link

btc commented Jun 9, 2016

I think this can be fixed in two steps.

  1. change the default datepicker_format.

  2. Fix an issue with Time.zone.parse in RecurringSelect.filter_params as I have done here: https://github.com/briantigerchow/recurring_select/commit/bbc430b7c378ecc43a7a1c692e1790cad7170cfd

Together, these two changes fix the date-month-mixed-up issue for me.

@bhushangahire
Copy link

Not sure if this is merged or not. But is there a way to add until field now?

@emilkarl
Copy link
Author

Wanna close this? :D

@jcw- jcw- closed this Mar 22, 2019
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

Successfully merging this pull request may close these issues.

6 participants