You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm integrating this calendar for birthdays, assuming the birthday is stored using the correct year (e.g. 1992-03-19).
I made this patch to add a boolean option called ignore_year which will ignore the year for the grouping of the events. I initially modified the date using change(year: Time.now.year), but I didn't like the contradiction.
I'm leaving this for posterity, I'm sure someone will benefit if searching for this in the issues.
Note that the addition is the date_key declaration using strftime to parse it, and using sorted_keys that receives a date, call the hash by that modified key. Also the option parameter reader.
This discussion was converted from issue #335 on March 07, 2024 05:16.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm integrating this calendar for birthdays, assuming the birthday is stored using the correct year (e.g.
1992-03-19
).I made this patch to add a boolean option called
ignore_year
which will ignore the year for the grouping of the events. I initially modified the date usingchange(year: Time.now.year)
, but I didn't like the contradiction.I'm leaving this for posterity, I'm sure someone will benefit if searching for this in the issues.
Note that the addition is the
date_key
declaration usingstrftime
to parse it, and usingsorted_keys
that receives a date, call the hash by that modified key. Also the option parameter reader.For the query of these "events", that in my case is people, I would query in the controller like this:
And calling like so.
If this is something that is welcomed as an addition to the gem, I would be happy to submit a PR.
Edit: Maybe the key should be called
events_ignore_year
or similar, since its not the calendar itself, but the events that are being modified.Beta Was this translation helpful? Give feedback.
All reactions