/// <summary>
        ///     Gets a value indicating whether <c>true</c> if times should be formatted as 24 hour times,
        ///     <c>false</c> if times should be formatted as 12 hour (AM/PM) times.
        /// </summary>
        /// <param name="locale">Locale to check.</param>
        /// <returns><c>true</c> if 24 hour time format is selected, <c>false</c> otherwise.</returns>
        public static bool Is24HourFormat(this NSLocale locale)
        {
            if (locale == null)
            {
                throw new ArgumentNullException(nameof(locale));
            }

            var template = NSDateFormatter.GetDateFormatFromTemplate("j", 0, locale);

            return(!template.Contains("a"));
        }
        public void GetDateFormatFromTemplateTest()
        {
            var          us_locale      = new NSLocale("en_US");
            var          gb_locale      = new NSLocale("en_GB");
            const string dateComponents = "yMMMMd";

            var dateFormat = NSDateFormatter.GetDateFormatFromTemplate(dateComponents, 0, us_locale);

            Assert.AreEqual("MMMM d, y", dateFormat, "#US");

            dateFormat = NSDateFormatter.GetDateFormatFromTemplate(dateComponents, 0, gb_locale);
            Assert.AreEqual("d MMMM y", dateFormat, "GB");
        }
 public AAPLDetailViewController(IntPtr handle) : base(handle)
 {
     dateFormatter            = new NSDateFormatter();
     dateFormatter.DateFormat = NSDateFormatter.GetDateFormatFromTemplate("HH:mm", 0, NSLocale.CurrentLocale);
     activityDataManager      = new ActivityDataManager();
 }