Skip to content
Merged
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
2 changes: 1 addition & 1 deletion app/controllers/api/v1/quotes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def render_not_found
def quote_params_with_defaults
quote_params.merge({
contract_start_date: Date.current,
contract_end_date: Date.current + 1,
contract_end_date: Date.current.next_year - 1.day,
contract_type_id: nil
})
end
Expand Down
4 changes: 3 additions & 1 deletion app/models/quote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Quote < ApplicationRecord
scope :completed, -> { where(step: 'completed') }

def contract_period
"#{contract_start_date} - #{contract_end_date}"
start_date = contract_start_date&.strftime('%m/%d/%Y')
end_date = contract_end_date&.strftime('%m/%d/%Y')
"#{start_date} - #{end_date}"
end

def self.last_unfinished
Expand Down