Menu

Tree [9fae22] default tip /
 History

Read Only access


File Date Author Commit
 Properties 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 .hgignore 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [9fae22] Update to .Net 4.0, and make tests pass.
 DOxygen Configuration.txt 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 NaturalDate.FxCop 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 NaturalDate.cs 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 NaturalDate.csproj 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 NaturalDate.sln 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [9fae22] Update to .Net 4.0, and make tests pass.
 NaturalDateTest.csproj 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [9fae22] Update to .Net 4.0, and make tests pass.
 NaturalSpan.cs 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 Program.cs 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 README.txt 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 Tests.cs 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [9fae22] Update to .Net 4.0, and make tests pass.
 Utility.cs 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 build_release.bat 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.
 dates.bnf 2011-06-08 Eric Hewitt@wizard.myhome.westell.com Eric Hewitt@wizard.myhome.westell.com [553889] Initial checkin of all source code.

Read Me

NaturalDate Natural Language Date Parsing .NET Module
-----------------------------------------------------

Please contact Precision Software Design, LLC at 
contact@precisionsoftware.us with any questions or comments.


Usage
-----
  1. Extract all zip file contents.
  2. Copy the Assembly file, NaturalDate.dll to your project directory.
  3. Add it as a reference to your project.
  4. Add the PrecisionSoftware namespace to the using list in your C# or Visual Basic file.
  5. Code against the NaturalDate API.  Documentation is found in API Documentation/index.html



Examples of date string parsable by NaturalDate
-----------------------------------------------
  1/1/2009, 12:00PM
  1/1/2009, 2-3 PM
  Jan 1, 2009, 2 to 3 PM
  January 1
  August 31st
  January 1, 2009
  January, 2009
  June 10-July 1, 2012
  Mondays, 6PM
  Mondays at 3PM
  Every Monday, 6PM
  Every Friday
  First Monday of every month
  Last Sunday of the month
  Everyday
  Everyday, 2 to 3 PM
  1st of the Month
  31st of every Month




Example usages of NaturalDate
-----------------------------
  1. Attempt to parse a date string:
    NaturalDate date;
    if (! NaturalDate.TryParse("January 1, 2009, 10-11PM", out date))
    {
      Console.WriteLine(date.ErrorString);
    }

  2. Enumerate a recurring date:
    foreach (NaturalDate d in 
      NaturalDate.Enumerate("Every Friday", "January 1, 2009"))
    {
      Console.WriteLine(d);
    }

  3. Find the next occurrence of a recurring date:
    Console.WriteLine(
      NaturalDate.Next("Every Friday at 7PM", "January 1, 2009"));

  4. Using Linq (.NET 3.5), this example walks the week ahead, starting with
    today, and finds all events that overlap each day.  It assumes EventList
    is an list of objects containing a 'When' property which is a NaturalDate.
    
    foreach (var day in NaturalDate.Enumerate("everyday", "today").Take(7))
    {
      var daysEvents = from e in EventList where e.When.Overlaps(day)
        orderby e.When.Next(day) select e;
      ...
    }
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.