Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
commit 2019b305e8daa862c757323c47b857c7510b40f3 2 parents 118972c + 3834835
@courtland authored
Showing with 13 additions and 4 deletions.
  1. +3 −0  CHANGELOG
  2. +10 −4 lib/active_scaffold/finder.rb
View
3  CHANGELOG
@@ -7,6 +7,9 @@
- messages go across all table
- display readonly associations in forms, it was ready to display them but it was skipping them
- Some fixes for inplace editors (cloning form overrides, ajax and radiobuttons). Add handlers for empty columns
+- add wrap_tag to list so cells content can be wrapped in a tag for better styling
+- fix date picker parsing for datetime fields when jquery is used
+- add as:element_updated js event when replace or replace_html is called
= 3.2.7
- restore missing update.persistent feature
View
14 lib/active_scaffold/finder.rb
@@ -121,11 +121,17 @@ def condition_value_for_datetime(value, conversion = :to_time)
Date.strptime(value, I18n.t('date.formats.default')) rescue nil
else
parts = Date._parse(value)
- time_parts = [[:hour, '%H'], [:min, '%M'], [:sec, '%S']].collect {|part, format_part| format_part if parts[part].present?}.compact
- format = "#{I18n.t('date.formats.default')} #{time_parts.join(':')} #{'%z' if parts[:offset].present?}"
+ format = I18n.translate 'time.formats.picker', :default => '' if ActiveScaffold.js_framework == :jquery
+ if format.blank?
+ time_parts = [[:hour, '%H'], [:min, '%M'], [:sec, '%S']].collect {|part, format_part| format_part if parts[part].present?}.compact
+ format = "#{I18n.t('date.formats.default')} #{time_parts.join(':')} #{'%z' if parts[:offset].present?}"
+ else
+ format += ' %z' if parts[:offset].present? && format !~ /%z/i
+ end
time = DateTime.strptime(value, format)
- time = Time.zone.local_to_utc(time) unless parts[:offset]
- time.in_time_zone.send(conversion) rescue nil
+ time = Time.zone.local_to_utc(time).in_time_zone unless parts[:offset]
+ time = time.send(conversion) unless conversion == :to_time
+ time
end unless value.nil? || value.blank?
end
Please sign in to comment.
Something went wrong with that request. Please try again.