From: <gn...@us...> - 2003-10-07 17:32:41
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Util In directory sc8-pr-cvs1:/tmp/cvs-serv24901/src/ICSharpCode/SharpCvsLib/Util Modified Files: DateParser.cs Log Message: Added support for dates of the form 'Thu Jun 5...' (double space between Jun and 5) Index: DateParser.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Util/DateParser.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DateParser.cs 1 Oct 2003 03:04:01 -0000 1.3 --- DateParser.cs 7 Oct 2003 17:32:29 -0000 1.4 *************** *** 53,57 **** /// </summary> public const String CVSNT1 = ! "ddd MMM dd HH':'mm':'ss yyyy"; // "ddd MMM dd HH:mm:ss yyyy"; /// <summary> --- 53,58 ---- /// </summary> public const String CVSNT1 = ! "ddd MMM d HH':'mm':'ss yyyy"; // single 'd' to support both single & double digit dates ! // "ddd MMM dd HH':'mm':'ss yyyy"; // "ddd MMM dd HH:mm:ss yyyy"; /// <summary> *************** *** 139,145 **** private static DateTime ParseCvsNT1 (String date) { return DateTime.ParseExact(date, CVSNT1, ! DateTimeFormatInfo.InvariantInfo); } --- 140,149 ---- private static DateTime ParseCvsNT1 (String date) { + // These dates sometimes contain space padded 'day of month' rather than + // zero padded which results in a double space. Hence the AllowWhiteSpaces. return DateTime.ParseExact(date, CVSNT1, ! DateTimeFormatInfo.InvariantInfo, ! DateTimeStyles.AllowWhiteSpaces); } |