﻿using drawMe.Services.Interfaces;
using System;

namespace drawMe.Services
{
    public class DaysTillChristmasService : IDaysTillChristmasService
    {
        public int GetDaysTillChristmas()
        {
            var currentDate = DateTime.Now.Date;
            var christmasDate = new DateTime(currentDate.Year, 12, 24);

            if (christmasDate < currentDate)
            {
                return 0;
            }

            return (int)(christmasDate - currentDate).TotalDays;
        }
    }
}