Commit 5177fccb by Ngô Trung Hưng

refactor method selected_date

parent 44da0847
Pipeline #1102 failed with stages
in 0 seconds
...@@ -10,10 +10,7 @@ ...@@ -10,10 +10,7 @@
border: 1px solid #ced4da; border: 1px solid #ced4da;
border-radius: 0.25rem; border-radius: 0.25rem;
height: 40px; height: 40px;
padding-top: 0.375rem; padding: 0.375rem 0.75rem 0.375rem 0.6rem;
padding-right: 0.75rem;
padding-bottom: 0.375rem;
padding-left: 0.6rem;
} }
@mixin admin_select__child { @mixin admin_select__child {
border: none; border: none;
...@@ -28,12 +25,10 @@ ...@@ -28,12 +25,10 @@
outline: none; outline: none;
} }
} }
.admin_box_search__filter_city_id { .admin_box_search__filter_city_id, .admin_box_search__filter_industry_id {
@include admin_select()
}
.admin_box_search__filter_industry_id {
@include admin_select() @include admin_select()
} }
.admin_box_search__filter_date { .admin_box_search__filter_date {
@include admin_select(); @include admin_select();
border: none !important; border: none !important;
...@@ -48,17 +43,15 @@ ...@@ -48,17 +43,15 @@
} }
} }
} }
.admin_box_search__filter_date__past_time { .admin_box_search__filter_date__past_time, .admin_box_search__filter_date__current_time {
width: 100%;
text-align: center;
}
.admin_box_search__filter_date__current_time {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.admin_box_search__btn { .admin_box_search__btn {
margin-top: 10px; margin-top: 10px;
} }
.admin_box_search__download { .admin_box_search__download {
width: 100%; width: 100%;
text-align: right; text-align: right;
...@@ -71,11 +64,7 @@ ...@@ -71,11 +64,7 @@
.btn-admin-search { .btn-admin-search {
width: 100%; width: 100%;
} }
#apply_city_id { #apply_city_id, #apply_industry_id {
@include admin_select__child()
}
#apply_industry_id {
@include admin_select__child() @include admin_select__child()
} }
......
...@@ -11,13 +11,20 @@ class Apply ...@@ -11,13 +11,20 @@ class Apply
def self.selected_date(params) def self.selected_date(params)
dt = {} dt = {}
dt[:selected_past_year] = params.present? ? params['past_time(1i)'].to_i : Date.current.year if params.present?
dt[:selected_past_month] = params.present? ? params['past_time(2i)'].to_i : Date.current.month debugger
dt[:selected_past_day] = params.present? ? params['past_time(3i)'].to_i : Date.current.day dt[:selected_past_year] = params['past_time(1i)'].to_i
dt[:selected_past_month] = params['past_time(2i)'].to_i
dt[:selected_past_day] = params['past_time(3i)'].to_i
dt[:selected_current_year] = params.present? ? params['current_time(1i)'].to_i : Date.current.year dt[:selected_current_year] = params['current_time(1i)'].to_i
dt[:selected_current_month] = params.present? ? params['current_time(2i)'].to_i : Date.current.month dt[:selected_current_month] = params['current_time(2i)'].to_i
dt[:selected_current_day] = params.present? ? params['current_time(3i)'].to_i : Date.current.day dt[:selected_current_day] = params['current_time(3i)'].to_i
else
dt[:selected_past_year] = dt[:selected_current_year] = Date.current.year
dt[:selected_past_month] = dt[:selected_current_month] = Date.current.month
dt[:selected_past_day] = dt[:selected_current_day] = Date.current.day
end
dt dt
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment