mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 23:35:00 +08:00
Fix sorting by time and time range columns [SCI-6683] (#4011)
This commit is contained in:
parent
347a53efc7
commit
1385c6964c
2 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RepositoryTimeRangeValue < RepositoryDateTimeRangeValueBase
|
||||
SORTABLE_COLUMN_NAME = 'repository_date_time_range_values.start_time::time'
|
||||
|
||||
def data_different?(new_data)
|
||||
data = new_data.is_a?(String) ? JSON.parse(new_data).symbolize_keys : new_data
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RepositoryTimeValue < RepositoryDateTimeValueBase
|
||||
SORTABLE_COLUMN_NAME = 'repository_date_time_values.data::time'
|
||||
|
||||
def data_different?(new_data)
|
||||
new_time = Time.zone.parse(new_data)
|
||||
new_time.min != data.min || new_time.hour != data.hour
|
||||
|
|
Loading…
Reference in a new issue