Skip to content

Instantly share code, notes, and snippets.

@atsmith813
atsmith813 / update_todays_birthdays.rb
Last active November 6, 2019 18:00
Update today's birthdays to be 1 year in the future
# Continuing with the birthdays, todays_birthdays, session, spreadsheet, and ws objects created above...
(1..ws.num_rows).each do |row|
name = ws[row, 1]
birthday = todays_birthdays.find { |bday| bday[:name] == name }
next unless birthday
next_birthday = birthday[:date].next_year.to_s
ws[row, 2] = next_birthday