Skip to content

tidalboot/TimeParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TimeParser

###What does it do? Makes your ugly dates look pretty!

###So how do I use it?

//given todays date is the 2015-10-22
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
var uglyDate: NSDate = dateFormatter.dateFromString("2015-10-21")!

let tidyDate: String = uglyDate.tidy(timeZoneOfDate: NSDate.timeZone.GMT)
//this returns "1 day ago"

And that's all there is to it!

About

Extension of NSDate to simplify the presentation of the length of time between a given date and the current time, for example if today were the 20th June then a date of 19th June would be presented as "1 day ago" using the built in tidy extension method.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages