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

namespace ZionRobot.Helpers
{
	// Token: 0x02000010 RID: 16
	internal class Shift
	{
		// Token: 0x06000053 RID: 83 RVA: 0x00004090 File Offset: 0x00002290
		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: 0x06000054 RID: 84 RVA: 0x000040B4 File Offset: 0x000022B4
		internal static bool isDuringTheWeek(DateTime date)
		{
			return date.DayOfWeek != DayOfWeek.Saturday && date.DayOfWeek > DayOfWeek.Sunday;
		}

		// Token: 0x06000055 RID: 85 RVA: 0x000040E0 File Offset: 0x000022E0
		internal static bool isWeekend(DateTime date)
		{
			return !Shift.isDuringTheWeek(date);
		}

		// Token: 0x06000056 RID: 86 RVA: 0x000040FC File Offset: 0x000022FC
		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: 0x06000057 RID: 87 RVA: 0x00004124 File Offset: 0x00002324
		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;
		}
	}
}
