Fix Error

This commit is contained in:
邱博亞 2024-08-21 21:48:11 +08:00
parent 7080cf7d4d
commit eb8b951253
2 changed files with 7 additions and 3 deletions

View File

@ -36,7 +36,11 @@
end
fields_name = fields_name - basic_keys
keys = basic_keys + fields_name
keys = keys.select{|field_name| tmp = property[field_name]; (tmp.is_a?(Hash) ? (tmp["enable"] == "1") : true) }
keys = keys.select do |field_name|
return true if field_name.include?('p_hire_fields.')
tmp = property[field_name]
tmp.is_a?(Hash) ? (tmp["enable"] == "1") : true
end
p_hire_fields = property.p_hire_fields_enabled.map{|rf| [rf.id.to_s,rf]}.to_h
has_p_hire_fields = p_hire_fields.count != 0
tmp_keys = []

View File

@ -797,12 +797,12 @@
</script>
<script>
$(document).ready(function(){
<% if property.p_hire_start_time %>
<% if property.p_open_start_time %>
$("#p_hire_start_time").datepicker('option', 'minDate', new Date("<%= property.p_open_start_time.strftime("%Y-%m-%d") %>"));
$("#p_hire_end_time").datepicker('option', 'minDate', new Date("<%= property.p_open_start_time.strftime("%Y-%m-%d") %>"));
$("#p_hire_recurring_end_date").datepicker('option', 'minDate', new Date("<%= property.p_open_start_time.strftime("%Y-%m-%d") %>"));
<% end %>
<% if property.p_hire_end_time %>
<% if property.p_open_end_time %>
$("#p_hire_start_time").datepicker('option', 'maxDate', new Date("<%= property.p_open_end_time.strftime("%Y-%m-%d") %>"));
$("#p_hire_end_time").datepicker('option', 'maxDate', new Date("<%= property.p_open_end_time.strftime("%Y-%m-%d") %>"));
$("#p_hire_recurring_end_date").datepicker('option', 'maxDate', new Date("<%= property.p_open_end_time.strftime("%Y-%m-%d") %>"));