Skip to content

Instantly share code, notes, and snippets.

@tanelsuurhans
Created February 18, 2013 15:03
Show Gist options
  • Save tanelsuurhans/4978039 to your computer and use it in GitHub Desktop.
Save tanelsuurhans/4978039 to your computer and use it in GitHub Desktop.
def quoted_date(value) #:nodoc:
result = super
if value.acts_like?(:time) && value.respond_to?(:usec)
result = "#{result}.#{sprintf("%06d", value.usec)}"
end
if value.year < 0
result = result.sub(/^-/, "") + " BC"
end
result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment