mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-07 06:56:18 +08:00
Merge pull request #8556 from artoscinote/ma_SCI_11989
Fix sorting projects/folders by date parameters [SCI-11989]
This commit is contained in:
commit
43a23da0c1
2 changed files with 8 additions and 5 deletions
|
|
@ -220,15 +220,15 @@ module Lists
|
|||
end
|
||||
|
||||
def project_start_date(object)
|
||||
return Date::Infinity.new unless project?(object)
|
||||
return Constants::INFINITE_DATE unless project?(object)
|
||||
|
||||
object.start_date || Date::Infinity.new
|
||||
object.start_date || Constants::INFINITE_DATE
|
||||
end
|
||||
|
||||
def project_due_date(object)
|
||||
return Date::Infinity.new unless project?(object)
|
||||
return Constants::INFINITE_DATE unless project?(object)
|
||||
|
||||
object.due_date || Date::Infinity.new
|
||||
object.due_date || Constants::INFINITE_DATE
|
||||
end
|
||||
|
||||
def project_status(object)
|
||||
|
|
@ -256,7 +256,7 @@ module Lists
|
|||
end
|
||||
|
||||
def project_timestamp(timestamp_name, object)
|
||||
project?(object) ? object[timestamp_name] : Date::Infinity.new
|
||||
project?(object) ? object[timestamp_name] : Constants::INFINITE_DATE
|
||||
end
|
||||
|
||||
def project?(object)
|
||||
|
|
|
|||
|
|
@ -449,6 +449,9 @@ class Constants
|
|||
done: '#5EC66F'
|
||||
}
|
||||
|
||||
# Infinite date, for use in sorting
|
||||
INFINITE_DATE = Date.new(9999, 1, 1).freeze
|
||||
|
||||
# Interval time for polling asset changes when editing with SciNote Edit
|
||||
ASSET_POLLING_INTERVAL = 5000
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue