public static TimeSlot Parse(MeetingTimeCandidate mtc)
        {
            var slot = mtc.MeetingTimeSlot;

            var start = DateTime.Parse(slot.Start.Date);
            var startTime = DateTime.Parse(slot.Start.Time);
            start += startTime.TimeOfDay;

            var end = DateTime.Parse(slot.End.Date);
            var endTime = DateTime.Parse(slot.End.Time);
            end += endTime.TimeOfDay;

            if (slot.Start.TimeZone.ToUpper().Contains("UTC"))
            {
                start = DateTime.SpecifyKind(start, DateTimeKind.Utc);
                end = DateTime.SpecifyKind(end, DateTimeKind.Utc);

                start = TimeZoneInfo.ConvertTime(start, TimeZoneInfo.Utc, TimeZoneInfo.Local);
                end = TimeZoneInfo.ConvertTime(end, TimeZoneInfo.Utc, TimeZoneInfo.Local);
            }

            return new TimeSlot
            {
                Start = start,
                End = end
            };
        }
예제 #2
0
        public static TimeSlot Parse(MeetingTimeCandidate mtc)
        {
            var slot = mtc.MeetingTimeSlot;

            var start     = DateTime.Parse(slot.Start.Date);
            var startTime = DateTime.Parse(slot.Start.Time);

            start += startTime.TimeOfDay;

            var end     = DateTime.Parse(slot.End.Date);
            var endTime = DateTime.Parse(slot.End.Time);

            end += endTime.TimeOfDay;

            if (slot.Start.TimeZone.ToUpper().Contains("UTC"))
            {
                start = DateTime.SpecifyKind(start, DateTimeKind.Utc);
                end   = DateTime.SpecifyKind(end, DateTimeKind.Utc);

                start = TimeZoneInfo.ConvertTime(start, TimeZoneInfo.Utc, TimeZoneInfo.Local);
                end   = TimeZoneInfo.ConvertTime(end, TimeZoneInfo.Utc, TimeZoneInfo.Local);
            }

            return(new TimeSlot
            {
                Start = start,
                End = end
            });
        }
 private void MeetingTimeCandidateSelected(MeetingTimeCandidate meetingTimeCandidate)
 {
     if (meetingTimeCandidate != null)
     {
         var slot = TimeSlot.Parse(meetingTimeCandidate);
         SetTimeSlot(slot);
     }
 }
 public static TimeSlot Parse(MeetingTimeCandidate mtc)
 {
     return new TimeSlot
     {
         Start = ParseTimeSlot(mtc.MeetingTimeSlot.Start),
         End = ParseTimeSlot(mtc.MeetingTimeSlot.End),
     };
 }
 private void ItemSelected(MeetingTimeCandidate item)
 {
     OnOk();
     GoBack();
 }