Permalink
Browse files

Merge pull request #114 from mbenjaminsmith/master

Added fix for issues #112 & #113
  • Loading branch information...
2 parents 9cd55c3 + 62d4c60 commit cdb53f616ed8828449844728e8ef003d14ae3f63 evands committed Jun 24, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 Classes/ReportManager.m
View
@@ -383,12 +383,13 @@ - (void)fetchReportsWithUserInfo:(NSDictionary *)userInfo
}
- viewState = parseViewState(salesPage);
+ viewState = parseViewState(salesPage);
NSString *dailyName = [salesPage stringByMatching:@"theForm:j_id_jsp_[0-9]*_6"];
- NSString *weeklyName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_22"];
- NSString *ajaxName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_2"];
- NSString *daySelectName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_43"];
- NSString *weekSelectName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_48"];
+ NSRange lastTwoChars = NSMakeRange([dailyName length] - 2, 2);
+ NSString *weeklyName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_22" options:0 range:lastTwoChars];
+ NSString *ajaxName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_2" options:0 range:lastTwoChars];
+ NSString *daySelectName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_43" options:0 range:lastTwoChars];
+ NSString *weekSelectName = [dailyName stringByReplacingOccurrencesOfString:@"_6" withString:@"_48" options:0 range:lastTwoChars];
// parse days available
NSMutableArray *availableDays = extractFormOptions(salesPage, @"theForm:datePickerSourceSelectElement");

0 comments on commit cdb53f6

Please sign in to comment.