Class representing a time slot of a day at an unspecified date.
Inheritance: Our.Umbraco.OpeningHours.Model.Json.OpeningHoursJsonObject
 /// <summary>
 /// Parses legacy values from <code>beta1</code>.
 /// </summary>
 private void ParseLegacyValues() {
     if (Items != null) return;
     if (JObject.GetBoolean("isOpen")) {
         TimeSpan opens = JObject.GetString("opens", TimeSpan.Parse);
         TimeSpan closes = JObject.GetString("closes", TimeSpan.Parse);
         Items = new[] {
             new OpeningHoursTimeSlot(opens, closes)
         };
     } else {
         Items = new OpeningHoursTimeSlot[0];
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Parses legacy values from <code>beta1</code>.
 /// </summary>
 private void ParseLegacyValues()
 {
     if (Items != null)
     {
         return;
     }
     if (JObject.GetBoolean("isOpen"))
     {
         TimeSpan opens  = JObject.GetString("opens", TimeSpan.Parse);
         TimeSpan closes = JObject.GetString("closes", TimeSpan.Parse);
         Items = new[] {
             new OpeningHoursTimeSlot(opens, closes)
         };
     }
     else
     {
         Items = new OpeningHoursTimeSlot[0];
     }
 }
 public OpeningHoursDayTimeSlot(DateTime date, OpeningHoursTimeSlot time)
 {
     Opens  = new DateTime(date.Year, date.Month, date.Day, time.Opens.Hours, time.Opens.Minutes, time.Opens.Seconds);
     Closes = new DateTime(date.Year, date.Month, date.Day, time.Closes.Hours, time.Closes.Minutes, time.Closes.Seconds);
 }
 public OpeningHoursDayTimeSlot(DateTime date, OpeningHoursTimeSlot time) {
     Opens = new DateTime(date.Year, date.Month, date.Day, time.Opens.Hours, time.Opens.Minutes, time.Opens.Seconds);
     Closes = new DateTime(date.Year, date.Month, date.Day, time.Closes.Hours, time.Closes.Minutes, time.Closes.Seconds);
 }