[iOS] display raw opening hours string for unsupported oh format

This commit is contained in:
Aleksey Belousov 2020-03-13 15:57:25 +03:00 committed by Alexander Boriskov
parent 30b83f2f3c
commit 0716b54bd7
3 changed files with 9 additions and 1 deletions

View file

@ -18,7 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) NSArray<WorkingDay *> *days;
@property(nonatomic, readonly) BOOL isClosedNow;
- (instancetype)initWithRawString:(NSString *)rawString localization:(id<IOpeningHoursLocalization>)localization;
- (nullable instancetype)initWithRawString:(NSString *)rawString
localization:(id<IOpeningHoursLocalization>)localization;
@end

View file

@ -40,6 +40,9 @@
wd.breaks = day.m_breaks;
[array addObject:wd];
}
if (array.count == 0) {
return nil;
}
_days = [array copy];
}
return self;

View file

@ -69,6 +69,7 @@ class PlacePageInfoViewController: UIViewController {
storyboard!.instantiateViewController(ofType: OpeningHoursViewController.self)
}()
private var rawOpeningHoursView: InfoItemViewController?
private var phoneView: InfoItemViewController?
private var websiteView: InfoItemViewController?
private var emailView: InfoItemViewController?
@ -96,6 +97,9 @@ class PlacePageInfoViewController: UIViewController {
if let openingHours = placePageInfoData.openingHours {
openingHoursView.openingHours = openingHours
addToStack(openingHoursView)
} else if let openingHoursString = placePageInfoData.openingHoursString {
rawOpeningHoursView = createInfoItem(openingHoursString, icon: UIImage(named: "ic_placepage_open_hours"))
rawOpeningHoursView?.infoLabel.numberOfLines = 0
}
if let phone = placePageInfoData.phone {