Class representing a time slot of a day at an unspecified date.
Inheritance: Our.Umbraco.OpeningHours.Model.Json.OpeningHoursJsonObject
コード例 #1
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];
     }
 }
コード例 #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];
     }
 }
コード例 #3
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);
 }
コード例 #4
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);
 }