calendar/app/views/calendars/_calendar_variable.html.erb

19 lines
1.1 KiB
Plaintext
Raw Normal View History

<script>
2022-07-13 07:00:21 +00:00
if(window.calendar_variable == undefined){
window.calendar_variable = {};
window.calendar_variable.from = "<%=t('calendar.from')%>";
window.calendar_variable.to = "<%=t('calendar.to')%>";
<% if @calendar_setting && @calendar_setting.enable %>
window.calendar_variable.sunday_first = <%=@calendar_setting.sunday_first%>;
window.calendar_variable.week_title = <%=@calendar_setting.week_title.to_s.html_safe%>;
window.calendar_variable.date_type = <%=@calendar_setting.date_type%>;
window.calendar_variable.time_type = <%=@calendar_setting.time_type%>;
2022-07-13 07:00:21 +00:00
window.calendar_variable.dayNames = <%=@calendar_setting.days.to_s.html_safe%>;
<% if I18n.locale == :zh_tw %>
window.calendar_variable.dayNamesShort = <%=@calendar_setting.days.map{|d| d[-1]}.to_s.html_safe%>;
<% else %>
window.calendar_variable.dayNamesShort = <%=@calendar_setting.days.map{|d| d[0...3]}.to_s.html_safe%>;
<% end %>
<% end %>
2022-07-13 07:00:21 +00:00
}
</script>