mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 22:52:05 +08:00
![Krzysztof Kotlarek](/assets/img/avatar_default.png)
It allows saving local date to calendar. Modal is giving option to pick between ics and google. User choice can be remembered as a default for the next actions.
16 lines
811 B
Plaintext
16 lines
811 B
Plaintext
BEGIN:VCALENDAR
|
|
VERSION:2.0
|
|
PRODID:-//Discourse//<%= Discourse.current_hostname %>//<%= Discourse.full_version %>//EN
|
|
<% @dates.each do |date, index| %>
|
|
BEGIN:VEVENT
|
|
UID:post_#<%= @post.id %>_<%= date[:starts_at].to_datetime.to_i %>_<%= date[:ends_at].to_datetime.to_i %>@<%= Discourse.current_hostname %>
|
|
DTSTAMP:<%= Time.now.utc.strftime("%Y%m%dT%H%M%SZ") %>
|
|
DTSTART:<%= date[:starts_at].to_datetime.strftime("%Y%m%dT%H%M%SZ") %>
|
|
DTEND:<%= date[:ends_at].presence ? date[:ends_at].to_datetime.strftime("%Y%m%dT%H%M%SZ") : (date[:starts_at].to_datetime + 1.hour).strftime("%Y%m%dT%H%M%SZ") %>
|
|
SUMMARY:<%= @title %>
|
|
DESCRIPTION:<%= PrettyText.format_for_email(@post.excerpt, @post).html_safe %>
|
|
URL:<%= Discourse.base_url %>/t/-/<%= @post.topic_id %>/<%= @post.post_number %>
|
|
END:VEVENT
|
|
<% end %>
|
|
END:VCALENDAR
|