using System;

namespace BMA.EHR.Recurit.Exam.Service.Extensions
{
    public static class TimeSpanExtension
    {
        #region " To days "

        public static double ConvertMillisecondsToDays(this double milliseconds)
        {
            return TimeSpan.FromMilliseconds(milliseconds).TotalDays;
        }

        public static double ConvertSecondsToDays(this double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalDays;
        }

        public static double ConvertMinutesToDays(this double minutes)
        {
            return TimeSpan.FromMinutes(minutes).TotalDays;
        }

        public static double ConvertHoursToDays(this double hours)
        {
            return TimeSpan.FromHours(hours).TotalDays;
        }

        #endregion

        #region " To hours "

        public static double ConvertMillisecondsToHours(this double milliseconds)
        {
            return TimeSpan.FromMilliseconds(milliseconds).TotalHours;
        }

        public static double ConvertSecondsToHours(this double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalHours;
        }

        public static double ConvertMinutesToHours(this double minutes)
        {
            return TimeSpan.FromMinutes(minutes).TotalHours;
        }

        public static double ConvertDaysToHours(this double days)
        {
            return TimeSpan.FromHours(days).TotalHours;
        }

        #endregion

        #region " To minutes "

        public static double ConvertMillisecondsToMinutes(this double milliseconds)
        {
            return TimeSpan.FromMilliseconds(milliseconds).TotalMinutes;
        }

        public static double ConvertSecondsToMinutes(this double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalMinutes;
        }

        public static double ConvertHoursToMinutes(this double hours)
        {
            return TimeSpan.FromHours(hours).TotalMinutes;
        }

        public static double ConvertDaysToMinutes(this double days)
        {
            return TimeSpan.FromDays(days).TotalMinutes;
        }

        #endregion

        #region " To seconds "

        public static double ConvertMillisecondsToSeconds(this double milliseconds)
        {
            return TimeSpan.FromMilliseconds(milliseconds).TotalSeconds;
        }

        public static double ConvertMinutesToSeconds(this double minutes)
        {
            return TimeSpan.FromMinutes(minutes).TotalSeconds;
        }

        public static double ConvertHoursToSeconds(this double hours)
        {
            return TimeSpan.FromHours(hours).TotalSeconds;
        }

        public static double ConvertDaysToSeconds(this double days)
        {
            return TimeSpan.FromDays(days).TotalSeconds;
        }

        #endregion

        #region " To milliseconds "

        public static double ConvertSecondsToMilliseconds(this double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalMilliseconds;
        }

        public static double ConvertMinutesToMilliseconds(this double minutes)
        {
            return TimeSpan.FromMinutes(minutes).TotalMilliseconds;
        }

        public static double ConvertHoursToMilliseconds(this double hours)
        {
            return TimeSpan.FromHours(hours).TotalMilliseconds;
        }

        public static double ConvertDaysToMilliseconds(this double days)
        {
            return TimeSpan.FromDays(days).TotalMilliseconds;
        }

        #endregion
    }
}