private async void LoadHistoryItems()
        {
            TextWidget loadingText = new TextWidget("Retrieving History from Web...");

            loadingText.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            scrollWindow.AddChild(loadingText);

            var results = await ApplicationController.GetProfileHistory?.Invoke(ProfileManager.Instance.ActiveProfile.DeviceToken);

            printerProfileData = results;
            if (printerProfileData != null)
            {
                loadingText.Visible = false;

                List <DateTime> sourceTimes = new List <DateTime>();
                foreach (var printerProfile in results.OrderByDescending(d => d.Key))
                {
                    // AppEngine results are current in the form of: "2016-07-21 00:43:30.965830"
                    sourceTimes.Add(Convert.ToDateTime(printerProfile.Key).ToLocalTime());
                }

                var groupedTimes = RelativeTime.GroupTimes(DateTime.Now, sourceTimes);

                FlowLayoutWidget topToBottomStuff = new FlowLayoutWidget(FlowDirection.TopToBottom);
                scrollWindow.AddChild(topToBottomStuff);
                foreach (var group in groupedTimes)
                {
                    // add in the group header
                    topToBottomStuff.AddChild(new TextWidget(RelativeTime.BlockDescriptions[group.Key], textColor: ActiveTheme.Instance.PrimaryTextColor)
                    {
                        Margin = new BorderDouble(0, 0, 0, 5),
                    });

                    foreach (var time in group.Value)
                    {
                        // add in the radio buttons
                        var profileVersionButton = new RadioButton(time.Value, textColor: ActiveTheme.Instance.PrimaryTextColor)
                        {
                            Margin = new BorderDouble(5, 0),
                        };
                        profileVersionButton.Checked = false;
                        radioButtonList.Add(profileVersionButton);
                        topToBottomStuff.AddChild(profileVersionButton);
                    }
                }

                foreach (var printerProfile in results)
                {
                    orderedProfiles.Add(printerProfile.Key.ToString());
                }
            }
            else
            {
                loadingText.Text      = "Failed To Download History!";
                loadingText.TextColor = RGBA_Bytes.Red;
            }

            //remove loading profile text/icon
        }
        public void RelativeFriendlyDatesTest()
        {
            {
                // May 28, 2016 at 3:13 pm
                DateTime nowTime = new DateTime(2016, 05, 28, 15, 13, 37);

                DateTime testTime = nowTime.AddMinutes(-63);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.Today);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "2:10 PM");

                testTime = nowTime.AddHours(-25);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.Yesterday);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "2:13 PM");

                testTime = nowTime.AddDays(-4);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.SameWeek);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "Tuesday 3:13 PM");

                testTime = nowTime.AddDays(-6);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.SameWeek);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "Sunday 3:13 PM");

                testTime = nowTime.AddDays(-7);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.SameMonth);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "May 21, 3:13 PM");

                testTime = nowTime.AddDays(-37);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.SameYear);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "April 21, 3:13 PM");

                testTime = nowTime.AddDays(-364);
                Assert.IsTrue(RelativeTime.GetTimeBlock(nowTime, testTime) == TimeBlock.PastYear);
                Assert.IsTrue(RelativeTime.GetDetail(nowTime, testTime) == "2015 May 30, 3:13 PM");
            }

            // make a grouped list
            {
                // May 28, 2016 at 3:13 pm
                DateTime        nowTime  = new DateTime(2016, 05, 28, 15, 13, 37);
                List <DateTime> allTimes = new List <DateTime>()
                {
                    nowTime.AddMinutes(-63),
                    nowTime.AddMinutes(-82),
                    nowTime.AddHours(-25),
                    nowTime.AddHours(-31),
                    nowTime.AddDays(-4),
                    nowTime.AddDays(-6),
                    nowTime.AddDays(-7),
                    nowTime.AddDays(-37),
                    nowTime.AddDays(-364),
                };

                var orderedForDisplay = RelativeTime.GroupTimes(nowTime, allTimes);
                Assert.IsTrue(orderedForDisplay.Count == 6);
                Assert.IsTrue(orderedForDisplay[TimeBlock.Today].Count == 2);
                Assert.IsTrue(orderedForDisplay[TimeBlock.Yesterday].Count == 2);
                Assert.IsTrue(orderedForDisplay[TimeBlock.SameWeek].Count == 2);
                Assert.IsTrue(orderedForDisplay[TimeBlock.SameMonth].Count == 1);
                Assert.IsTrue(orderedForDisplay[TimeBlock.SameYear].Count == 1);
                Assert.IsTrue(orderedForDisplay[TimeBlock.PastYear].Count == 1);
            }
        }