app/helpers/datetime_helper.rb in drexed-datetime-0.0.5 vs app/helpers/datetime_helper.rb in drexed-datetime-0.0.6

- old
+ new

@@ -1,84 +1,161 @@ module DatetimeHelper - - def month_day_and_time_for(tach) + + ## Ex. 2013 + def year_for(tach) unless tach.blank? - tach.strftime("%B %e at %I:%M %p") + tach.strftime("%Y") end end - - def date_time_for(tach) + + ## Ex. December + def month_name_for(tach) unless tach.blank? - tach.strftime("%B %e, %Y at %I:%M %p") + tach.strftime("%B") end end - - def date_for(tach) + + ## Ex. Dec + def abbr_month_name_for(tach) unless tach.blank? - tach.strftime("%B %e, %Y") + tach.strftime("%b") end end - - def twenty_four_hour_time_for(tach) + + ## Ex. 4 + def day_number_for(tach) unless tach.blank? - tach.strftime("%H:%M") + tach.strftime("%e") end end + + ## Ex. Wednesday + def day_name_for(tach) + unless tach.blank? + tach.strftime("%A") + end + end + ## Ex. Wed + def abbr_day_name_for(tach) + unless tach.blank? + tach.strftime("%a") + end + end + + ## Ex. 07:13 PM def twelve_hour_time_for(tach) unless tach.blank? tach.strftime("%I:%M %p") end end - - def month_name_for(tach) + + ## Ex. 07:13 PM EST + def twelve_hour_time_with_timezone_for(tach) unless tach.blank? - tach.strftime("%B") + tach.strftime("%I:%M %p") end end - - def abbr_month_name_for(tach) + + ## Ex. 19:12 + def twenty_four_hour_time_for(tach) unless tach.blank? - tach.strftime("%b") + tach.strftime("%H:%M") end end - - def day_name_for(tach) + + ## Ex. 19:12 EST + def twenty_four_hour_time_with_timezone_for(tach) unless tach.blank? - tach.strftime("%A") + tach.strftime("%H:%M %Z") end end - - def day_number_for(tach) + + ## Ex. December 4 at 07:11 PM + def month_day_and_time_for(tach) unless tach.blank? - tach.strftime("%e") + tach.strftime("%B %e at %I:%M %p") end end - - def abbr_day_name_for(tach) + + ## Ex. Dec 4 at 07:11 PM + def abbr_month_day_and_time_for(tach) unless tach.blank? - tach.strftime("%a") + tach.strftime("%b %e at %I:%M %p") end end - - def abbr_month_and_day_for(tach) + + ## Ex. December 4 at 07:11 PM EST + def month_day_and_time_with_timezone_for(tach) unless tach.blank? - tach.strftime("%b %d") + tach.strftime("%B %e at %I:%M %p %Z") end end - + + ## Ex. Dec 4 at 07:11 PM EST + def abbr_month_day_and_time_with_timezone_for(tach) + unless tach.blank? + tach.strftime("%b %e at %I:%M %p %Z") + end + end + + ## Ex. December 4, 2013 at 07:11 PM + def datetime_for(tach) + unless tach.blank? + tach.strftime("%B %e, %Y at %I:%M %p") + end + end + + ## Ex. Dec 4, 2013 at 07:11 PM + def abbr_datetime_for(tach) + unless tach.blank? + tach.strftime("%b %e, %Y at %I:%M %p") + end + end + + ## Ex. December 4, 2013 at 07:11 PM EST + def datetime_with_timezone_for(tach) + unless tach.blank? + tach.strftime("%B %e, %Y at %I:%M %p %Z") + end + end + + ## Ex. Dec 4, 2013 at 07:11 PM EST + def abbr_datetime_with_timezone_for(tach) + unless tach.blank? + tach.strftime("%b %e, %Y at %I:%M %p %Z") + end + end + + ## Ex. December 4, 2013 + def date_for(tach) + unless tach.blank? + tach.strftime("%B %e, %Y") + end + end + + ## Ex. Dec 4, 2013 def abbr_date_for(tach) unless tach.blank? - tach.strftime("%b %d, %Y") + tach.strftime("%b %e, %Y") end end - def abbr_date_time_for(tach) + ## Ex. December 4 + def month_and_day_for(tach) unless tach.blank? - tach.strftime("%b %d, %Y at %I:%M %p") + tach.strftime("%B %e") end end + ## Ex. Dec 4 + def abbr_month_and_day_for(tach) + unless tach.blank? + tach.strftime("%b %e") + end + end + + ## Ex. EST def timezone_name_for(tach) unless tach.blank? tach.strftime("%Z") end end \ No newline at end of file