Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Date and Time Format #318

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ gem 'stimulus-rails'
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem 'jbuilder'

#Rails forms
gem 'simple_form'

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ GEM
net-smtp (0.3.3)
net-protocol
nio4r (2.5.8)
nokogiri (1.14.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-linux)
Expand Down Expand Up @@ -267,8 +269,12 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
simple_form (5.2.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
singleton (0.1.1)
smart_properties (1.17.0)
sqlite3 (1.6.1-arm64-darwin)
sqlite3 (1.6.1-x86_64-darwin)
sqlite3 (1.6.1-x86_64-linux)
stimulus-rails (1.2.1)
Expand Down Expand Up @@ -311,6 +317,7 @@ GEM
zeitwerk (2.6.7)

PLATFORMS
arm64-darwin-21
x86_64-darwin-22
x86_64-linux

Expand All @@ -336,6 +343,7 @@ DEPENDENCIES
rubocop-rails
savon
selenium-webdriver
simple_form
sqlite3 (~> 1.4)
stimulus-rails
syntax_tree
Expand Down
3 changes: 1 addition & 2 deletions app/helpers/organization_timeline_entries_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def format_duration(time)
end

def date_and_time(display_date_and_time)
#[date(display_date_and_time), time(display_date_and_time)].compact.join(' ')
display_date_and_time
[display_date_and_time.to_date.strftime('%m/%d/%Y'), display_date_and_time.strftime("%H:%M %p")].compact.join(' ')
end
end
4 changes: 2 additions & 2 deletions app/views/organization_timeline_entries/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%= simple_form_for @organization_timeline_entry do |f| %>
<div class="form-inputs">
<%= f.input :description %>
<%= f.input :ended_at, placeholder: @organization_timeline_entry.ended_at %>
<%= f.input :started_at, placeholder: @organization_timeline_entry.started_at %>
</div>
<%= f.input :ended_at, placeholder: @organization_timeline_entry.ended_at %>

<div class="form-actions">
<%= f.button :submit, class: 'btn-primary' %>
<%= link_to t('.cancel', default: t('helpers.links.cancel')),
Expand Down