Skip to content

Instantly share code, notes, and snippets.

@samrayner
Created April 29, 2016 10:55
Show Gist options
  • Save samrayner/286669cb68a1c8ea99b95c60fc0d02a5 to your computer and use it in GitHub Desktop.
Save samrayner/286669cb68a1c8ea99b95c60fc0d02a5 to your computer and use it in GitHub Desktop.
def titled_time_tag(time, *args, &block)
options = args.extract_options!
format = options.delete(:format) || :mon_d_12hr
content = args.first || time.to_s(format)
time_tag time, content, options.reverse_merge(title: time.to_s(:long)), &block
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment