Skip to content

Commit fcd91f5

Browse files
date (#234)
Co-authored-by: Vijay Swamidass <[email protected]>
1 parent 485a431 commit fcd91f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/views/documents/index.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
<div class="flex space-x-4">
2424
<div class="flex-1">
2525
<label for="since" class="block text-sm font-medium text-stone-700 mb-1">Updated Since:</label>
26-
<input type="datetime-local" name="since" id="since" value="<%= params[:since] %>" class="w-full rounded-lg p-2 border border-stone-300 text-sm">
26+
<% since_value = params[:since].present? ? Time.parse(params[:since]).strftime('%Y-%m-%dT%H:%M') : '' rescue '' %>
27+
<input type="datetime-local" name="since" id="since" value="<%= since_value %>" class="w-full rounded-lg p-2 border border-stone-300 text-sm">
2728
</div>
2829
<div class="flex-1">
2930
<label for="until" class="block text-sm font-medium text-stone-700 mb-1">Updated Until:</label>
30-
<input type="datetime-local" name="until" id="until" value="<%= params[:until] %>" class="w-full rounded-lg p-2 border border-stone-300 text-sm">
31+
<% until_value = params[:until].present? ? Time.parse(params[:until]).strftime('%Y-%m-%dT%H:%M') : '' rescue '' %>
32+
<input type="datetime-local" name="until" id="until" value="<%= until_value %>" class="w-full rounded-lg p-2 border border-stone-300 text-sm">
3133
</div>
3234
</div>
3335
</div>

0 commit comments

Comments
 (0)