Problem
This code checks a string called breakfastHours
similar to
1567
which translates to Monday, Friday, Saturday, Sunday
.
1 = Monday
2 = Tuesday
….
7 = Sunday
The user then checks the boxes for the days they visited the club, which is all handled within jQuery later on, with the chkB{0}
tags.
#region BuildOpeningHours
private string BuildOpeningHours() {
StringBuilder sb = new StringBuilder();
string hoursPrefix = "Opening";
if (listing.ListingTypeParentName == "restaurants-dining") {
//display opening hours
if (!String.IsNullOrEmpty(listing.BreakfastOpeningDays) || !String.IsNullOrEmpty(listing.LunchOpeningDays) || !String.IsNullOrEmpty(listing.DinnerOpeningDays)) {
sb.Append(OpeningHoursTable(listing.BreakfastOpeningDays, listing.LunchOpeningDays, listing.DinnerOpeningDays, listing.LateOpeningDays));
} else if (!String.IsNullOrEmpty(listing.OpeningHours)) {
sb.AppendFormat("<p itemprop="openingHours"">{0}</p>""
Solution
listing.OpeningHours);