show default date on the page

This commit is contained in:
Pete Matsyburka
2024-03-31 17:34:23 +03:00
parent d4940234b7
commit 1b31772ff6
3 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -33,9 +33,10 @@
<% end %>
<% end %>
</div>
<% elsif field['type'] == 'date' && value != '{{date}}' %>
<% elsif field['type'] == 'date' %>
<autosize-field></autosize-field>
<div class="flex items-center px-0.5">
<% value = Time.current.in_time_zone(local_assigns[:timezone]).to_date.to_s if value == '{{date}}' %>
<%= TimeUtils.format_date_string(value, field.dig('preferences', 'format'), local_assigns[:locale]) %>
</div>
<% else %>