Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module TimeFormatter
- include MyFormats
- refine String do
- def format_to_my_name
- self.gsub(MY_NAME_FORMAT,"")
- end
- end
- refine Time do
- def format_to_my_datetime(timezone)
- self.getlocal(timezone).strftime(MY_DATETIME_FORMAT)
- end
- end
- refine ActiveSupport::TimeWithZone do
- def method_missing(method, *args)
- if Time.respond_to?(method)
- self.to_time.send(:method, *args)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement