Created
June 3, 2024 00:26
-
-
Save StevenJL/8ae36e14aea04694055cec0f2471dc50 to your computer and use it in GitHub Desktop.
Periodoxical LinkedIn Discussion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.linkedin.com/feed/update/urn:li:activity:7202561717019578368?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7202561717019578368%2C7202905522717552640%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287202905522717552640%2Curn%3Ali%3Aactivity%3A7202561717019578368%29 | |
# Schedule A is a meeting every other Monday at 4pm | |
# Schedule B is a reminder email for the meeting sent 2 days before it | |
require "periodoxical" | |
schedule_a = Periodoxical.generate( | |
time_zone: 'America/Los_Angeles', | |
start_date: '2024-06-02', | |
days_of_week: { | |
mon: { every_other_nth: 2 }, | |
}, | |
limit: 100, | |
time_blocks: [ | |
{ start_time: '4:00PM', end_time: '5:00PM' }, | |
], | |
) | |
schedule_b = schedule_a.map { |tb| { start: tb[:start] - 2, end: tb[:end] - 2 } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment