Revision: 18386
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18386&view=rev
Author:   hofman
Date:     2012-01-09 22:13:20 +0000 (Mon, 09 Jan 2012)
Log Message:
-----------
use 1 for month when empty in smart parsing of month and year, so the default 
formatters can work

Modified Paths:
--------------
    trunk/bibdesk/NSDate_BDSKExtensions.m

Modified: trunk/bibdesk/NSDate_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSDate_BDSKExtensions.m       2012-01-09 18:59:56 UTC (rev 
18385)
+++ trunk/bibdesk/NSDate_BDSKExtensions.m       2012-01-09 22:13:20 UTC (rev 
18386)
@@ -121,7 +121,7 @@
             }
             if (node == nil)
                 monthString = [(BDSKStringNode *)[nodes objectAtIndex:0] 
value];
-        } else if (monthString) {
+        } else if ([NSString isEmptyString:monthString] == NO) {
             NSRange r = [monthString rangeOfCharacterFromSet:[NSCharacterSet 
letterCharacterSet]];
             NSUInteger start = 0, end = [monthString length];
             if (r.location != NSNotFound) {
@@ -140,9 +140,9 @@
             }
             if (start > 0 || end < [monthString length])
                 monthString = [monthString 
substringWithRange:NSMakeRange(start, end - start)];
-        } else {
-            monthString = @"";
         }
+        if ([NSString isEmptyString:monthString])
+            monthString = @"1";
         return [self initWithMonthDayYearString:[NSString 
stringWithFormat:@"%@-15-%@", monthString, yearString]];
     }
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to