using System;
using System.Collections.Generic;
using System.Globalization;

namespace ZionRobot.Helpers
{
	// Token: 0x02000015 RID: 21
	internal class Shift
	{
		// Token: 0x06000079 RID: 121 RVA: 0x00004A10 File Offset: 0x00002C10
		internal static bool isDateValid(string date, string culture = "pt-BR", DateTimeStyles timeStyle = DateTimeStyles.None)
		{
			DateTime dateTime;
			return DateTime.TryParse(date, new CultureInfo(culture), timeStyle, out dateTime);
		}

		// Token: 0x0600007A RID: 122 RVA: 0x00004A34 File Offset: 0x00002C34
		internal static bool isDuringTheWeek(DateTime date)
		{
			return date.DayOfWeek != DayOfWeek.Saturday && date.DayOfWeek > DayOfWeek.Sunday;
		}

		// Token: 0x0600007B RID: 123 RVA: 0x00004A60 File Offset: 0x00002C60
		internal static bool isWeekend(DateTime date)
		{
			return !Shift.isDuringTheWeek(date);
		}

		// Token: 0x0600007C RID: 124 RVA: 0x00004A7C File Offset: 0x00002C7C
		internal static string formatDate(string date, string format = "dd//MM/yyyy HH:mm:ss", string culture = "pt-BR")
		{
			return DateTime.Parse(date, new CultureInfo(culture)).ToString(format);
		}

		// Token: 0x0600007D RID: 125 RVA: 0x00004AA4 File Offset: 0x00002CA4
		internal static List<DateTime> getDaysWithInterval(DateTime from, int interval = 30, bool onlyBusiness = true)
		{
			List<DateTime> result = new List<DateTime>();
			DateTime endDate = from.AddDays(30.0);
			DateTime date = from;
			while (date <= endDate)
			{
				bool flag = onlyBusiness && Shift.isDuringTheWeek(date);
				if (flag)
				{
					result.Add(date);
				}
				bool flag2 = !onlyBusiness;
				if (flag2)
				{
					result.Add(date);
				}
				date = date.AddDays(1.0);
			}
			return result;
		}
	}
}
