scinote-web/app/components/reports/date_input_component.html.erb

21 lines
786 B
Text
Raw Normal View History

<% if @editing %>
<div class="sci-input-container">
<%= label_tag @name, @label %>
<div class="datetime-picker-container">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-calendar"></span>
<input type="datetime"
name="<%= @name %>"
data-toggle='date-time-picker'
class="sci-input-field"
placeholder="<%= @placeholder %>"
data-date-format="<%= datetime_picker_format_date_only %>"
data-date-locale="<%= I18n.locale %>"
data-date-use-current="false"
data-type="DateInputComponent"
value="<%= @value.present? ? l(Date.parse(@value), format: :full) : '' %>"/>
</div>
</div>
<% else %>
<%= @value.present? ? l(Date.parse(@value), format: :full) : '' %>
<% end %>