Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pooza committed Feb 25, 2025
1 parent ae4f972 commit e9566e5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions app/lib/tomato_shrieker/source/icalendar_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ def create_entry(event)
location: fedi_sanitize(event.location),
all_day: event.dtstart.is_a?(Icalendar::Values::Date),
}
# Google Calendarで、終日予定の終了日が1日ずれる。
data[:end_date] -= 1.days if data[:all_day] && (data[:start_date] < data[:end_date])
data = fix_duration(data)
data = fix_body(data)
data = fix_location(data)
return data
end

Expand Down Expand Up @@ -123,6 +124,20 @@ def self.all(&block)

private

def fix_duration(data)
# Google Calendarで、終日予定の終了日が1日ずれる。
data[:end_date] -= 1.days if data[:all_day] && (data[:start_date] < data[:end_date])
return data
end

def fix_body(data)
return data
end

def fix_location(data)
return data
end

def start_time_today
return Time.parse(Time.now.strftime('%Y/%m/%d 00:00:00'))
end
Expand Down

0 comments on commit e9566e5

Please sign in to comment.