From 4f9fbc1ac06302f186beb661bd0b377d69e2b6e7 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Fri, 11 Oct 2024 16:24:47 -0700 Subject: [PATCH] Improve pet type "Added" timestamp styles --- app/assets/stylesheets/application/rainbow-pool.sass | 2 ++ app/views/pet_types/_pet_type.html.haml | 6 +++++- config/initializers/date_formats.rb | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application/rainbow-pool.sass b/app/assets/stylesheets/application/rainbow-pool.sass index 2c8d3b3a..32f823d9 100644 --- a/app/assets/stylesheets/application/rainbow-pool.sass +++ b/app/assets/stylesheets/application/rainbow-pool.sass @@ -57,6 +57,8 @@ .info font-size: .85em + p + margin-block: .25em .rainbow-pool-pagination margin-block: .5em diff --git a/app/views/pet_types/_pet_type.html.haml b/app/views/pet_types/_pet_type.html.haml index 819d39b0..82991b49 100644 --- a/app/views/pet_types/_pet_type.html.haml +++ b/app/views/pet_types/_pet_type.html.haml @@ -3,7 +3,6 @@ = pet_type_image pet_type, :happy, :thumb, class: "preview" .name= pet_type.human_name .info - %p Added #{time_with_only_month_if_old pet_type.created_at} - if support_staff? %p - if pet_type.num_unlabeled_states > 0 @@ -15,3 +14,8 @@ - else = moon_progress pet_type.num_poses, pet_type.num_poses + pet_type.num_missing_poses #{pet_type.num_poses}/#{pet_type.num_poses + pet_type.num_missing_poses} + %p + Added + = time_tag pet_type.created_at, + title: pet_type.created_at.to_formatted_s(:long_nst) do + = time_with_only_month_if_old pet_type.created_at diff --git a/config/initializers/date_formats.rb b/config/initializers/date_formats.rb index bf383589..f4e46e4f 100644 --- a/config/initializers/date_formats.rb +++ b/config/initializers/date_formats.rb @@ -1 +1,5 @@ Date::DATE_FORMATS[:month_and_day] = "%B %e" +Time::DATE_FORMATS[:long_nst] = lambda { |time| + time.in_time_zone("Pacific Time (US & Canada)"). + to_formatted_s(:long) + " NST" +}