Sha256: 39b8fba64661a0d6606d7ea30fdb12fe2fcb94d4d29b45eb24c0cff101fbd0df
Contents?: true
Size: 644 Bytes
Versions: 6
Compression:
Stored size: 644 Bytes
Contents
#------------------------------------------------------------------------------ class DateTime #------------------------------------------------------------------------------ def to_age (DateTime.now - self).to_i / 365 end #------------------------------------------------------------------------------ def localize(options = {}) options = {:format => options} if options.class == String I18n.localize(self, options) end # Create a unique sortable index for this date #------------------------------------------------------------------------------ def to_index yday + (year-2000) * 1000 end end
Version data entries
6 entries across 6 versions & 1 rubygems