Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

PrettyTime.NET is an OpenSource .NET time comparison library for creating human readable time. This is a modified version of PrettyTime, created by Lincoln Baxter, III from OcpSoft. PrettyTime can be found at http://code.google.com/p/prettytime/. Completely customizable, PrettyTime.NET creates ... [More] human readable, relative timestamps like those seen on Digg, Twitter, Gmail, Facebook and FeedWatchdog. It's simple, get started "right now!" Simple Exampleprivate string PrettyItUp(DateTime Date) { using (PrettyTime.PrettyTime p = new PrettyTime.PrettyTime()) return p.format(Date); }minutes from now test/// /// A test for minutes from now /// [TestMethod()] public void MinutesFromNow() { using (PrettyTime p = new PrettyTime()) { Assert.AreEqual(“12 minutes from now”, p.format(DateTime.Now.AddMinutes(12))); } }days ago test/// /// A test for days ago /// [TestMethod()] public void DaysAgo() { using (PrettyTime p = new PrettyTime()) { Assert.AreEqual(“3 days ago”, p.format(DateTime.Now.AddDays(-3))); } } [Less]

0
 
  0 reviews  |  0 users  |  964 lines of code  |  0 current contributors  |  Analyzed 9 days ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.