Skip to content

Commit 7bbcc67

Browse files
committed
PC-204: Improve contract period format and default end date
1 parent 209de06 commit 7bbcc67

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/controllers/api/v1/quotes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def render_not_found
5959
def quote_params_with_defaults
6060
quote_params.merge({
6161
contract_start_date: Date.current,
62-
contract_end_date: Date.current + 1,
62+
contract_end_date: Date.current.next_year - 1.day,
6363
contract_type_id: nil
6464
})
6565
end

app/models/quote.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class Quote < ApplicationRecord
2323
scope :completed, -> { where(step: 'completed') }
2424

2525
def contract_period
26-
"#{contract_start_date} - #{contract_end_date}"
26+
start_date = contract_start_date&.strftime('%m/%d/%Y')
27+
end_date = contract_end_date&.strftime('%m/%d/%Y')
28+
"#{start_date} - #{end_date}"
2729
end
2830

2931
def self.last_unfinished

0 commit comments

Comments
 (0)