diff --git a/src/Persia.Net.Test/PersianDateTimeTests.cs b/src/Persia.Net.Test/PersianDateTimeTests.cs index 1850eae..848ba57 100644 --- a/src/Persia.Net.Test/PersianDateTimeTests.cs +++ b/src/Persia.Net.Test/PersianDateTimeTests.cs @@ -1,6 +1,4 @@ -using Persia.Net.DateTimes; - -namespace Persia.Net.Test +namespace Persia.Net.Test { public class PersianDateTimeTests { diff --git a/src/Persia.Net/Constants/CalendarConstants.cs b/src/Persia.Net/Constants/CalendarConstants.cs index cda362b..e5d40b5 100644 --- a/src/Persia.Net/Constants/CalendarConstants.cs +++ b/src/Persia.Net/Constants/CalendarConstants.cs @@ -1,4 +1,4 @@ -namespace Persia.Net.Constants; +namespace Persia.Net; internal class CalendarConstants { diff --git a/src/Persia.Net/Constants/PersianCalendarConstants.cs b/src/Persia.Net/Constants/PersianCalendarConstants.cs index 124263a..be97ce0 100644 --- a/src/Persia.Net/Constants/PersianCalendarConstants.cs +++ b/src/Persia.Net/Constants/PersianCalendarConstants.cs @@ -1,4 +1,4 @@ -namespace Persia.Net.Constants; +namespace Persia.Net; public class PersianCalendarConstants { diff --git a/src/Persia.Net/DateTimes/Converter.cs b/src/Persia.Net/DateTimes/Converter.cs index 6993119..e2d90e0 100644 --- a/src/Persia.Net/DateTimes/Converter.cs +++ b/src/Persia.Net/DateTimes/Converter.cs @@ -1,6 +1,6 @@ -namespace Persia.Net.DateTimes; +namespace Persia.Net; -using static Constants.CalendarConstants; +using static CalendarConstants; internal static class Converter { diff --git a/src/Persia.Net/DateTimes/DateTimeExtensions.cs b/src/Persia.Net/DateTimes/DateTimeExtensions.cs index bf9d03b..17d9875 100644 --- a/src/Persia.Net/DateTimes/DateTimeExtensions.cs +++ b/src/Persia.Net/DateTimes/DateTimeExtensions.cs @@ -1,7 +1,6 @@ -using Persia.Net.Enums; -using Persia.Net.Words; +using Persia.Net; -namespace Persia.Net.DateTimes; +namespace Persia.Net; public static class DateTimeExtensions { diff --git a/src/Persia.Net/DateTimes/NullableDateTimeExtensions.cs b/src/Persia.Net/DateTimes/NullableDateTimeExtensions.cs index bee9841..47da98e 100644 --- a/src/Persia.Net/DateTimes/NullableDateTimeExtensions.cs +++ b/src/Persia.Net/DateTimes/NullableDateTimeExtensions.cs @@ -1,6 +1,5 @@ -using Persia.Net.Enums; - -namespace Persia.Net.DateTimes; + +namespace Persia.Net; public static class NullableDateTimeExtensions { @@ -154,6 +153,14 @@ public static PersianDateTime[] NextPersianMonth(this DateTime? date) return date.Value.NextPersianMonth(); } + /// + /// Calculates the dates of the Previous Persian month for a given date. + /// + /// The date for which to calculate the Previous Persian month. If null, an ArgumentNullException is thrown. + /// An array of objects representing each day of the Previous Persian month. + /// + /// This method first converts the given date to a Persian date. It then creates a new for each day of the Previous month, starting from the first day of the Previous month. + /// public static PersianDateTime[] PreviousPersianMonth(this DateTime? date) { if (!date.HasValue) diff --git a/src/Persia.Net/DateTimes/PersianDateOnly.cs b/src/Persia.Net/DateTimes/PersianDateOnly.cs index c498176..7ed0077 100644 --- a/src/Persia.Net/DateTimes/PersianDateOnly.cs +++ b/src/Persia.Net/DateTimes/PersianDateOnly.cs @@ -1,4 +1,4 @@ -namespace Persia.Net.DateTimes; +namespace Persia.Net; public class PersianDateOnly(int year, int month, int day) { diff --git a/src/Persia.Net/DateTimes/PersianDateTime.cs b/src/Persia.Net/DateTimes/PersianDateTime.cs index df59da5..160ca68 100644 --- a/src/Persia.Net/DateTimes/PersianDateTime.cs +++ b/src/Persia.Net/DateTimes/PersianDateTime.cs @@ -1,8 +1,8 @@ -using Persia.Net.Words; -using static Persia.Net.Constants.CalendarConstants; -using static Persia.Net.Constants.PersianCalendarConstants; +using Persia.Net; +using static Persia.Net.CalendarConstants; +using static Persia.Net.PersianCalendarConstants; -namespace Persia.Net.DateTimes; +namespace Persia.Net; public partial class PersianDateTime { @@ -378,7 +378,7 @@ public PersianDateTime AddMonths(int months) /// /// Converts the specified string representation of a date to its PersianDateTime equivalent. /// - /// A string containing a date to convert. + /// A string containing a date to convert. Expected format is 'yyyy/MM/dd'. /// A boolean value that indicates whether to use the current system time. If true, the current system time is used; otherwise, the time is set to 00:00:00. /// /// A PersianDateTime equivalent to the date contained in the input string. @@ -402,7 +402,7 @@ public static PersianDateTime Parse(string date, bool systemClock = false) /// /// Tries to convert the specified string representation of a date to its PersianDateTime equivalent, and returns a value that indicates whether the conversion succeeded. /// - /// A string containing a date to convert. + /// A string containing a date to convert. Expected format is 'yyyy/MM/dd'. /// When this method returns, contains the PersianDateTime equivalent to the date contained in the input string, if the conversion succeeded, or null if the conversion failed. The conversion fails if the input string is not in the correct format, or represents a date that is not possible in the Persian calendar. This parameter is passed uninitialized. /// A boolean value that indicates whether to use the current system time. If true, the current system time is used; otherwise, the time is set to 00:00:00. /// diff --git a/src/Persia.Net/DateTimes/PersianDateTimeComparable.cs b/src/Persia.Net/DateTimes/PersianDateTimeComparable.cs index a17a33a..8175c31 100644 --- a/src/Persia.Net/DateTimes/PersianDateTimeComparable.cs +++ b/src/Persia.Net/DateTimes/PersianDateTimeComparable.cs @@ -1,4 +1,4 @@ -namespace Persia.Net.DateTimes; +namespace Persia.Net; public partial class PersianDateTime : IEquatable, IComparable { diff --git a/src/Persia.Net/Enums/TimeUnit.cs b/src/Persia.Net/Enums/TimeUnit.cs index f6cea05..d25d246 100644 --- a/src/Persia.Net/Enums/TimeUnit.cs +++ b/src/Persia.Net/Enums/TimeUnit.cs @@ -1,4 +1,4 @@ -namespace Persia.Net.Enums; +namespace Persia.Net; public enum TimeUnit { diff --git a/src/Persia.Net/Words/PersianWords.cs b/src/Persia.Net/Words/PersianWords.cs index dad72aa..93edc30 100644 --- a/src/Persia.Net/Words/PersianWords.cs +++ b/src/Persia.Net/Words/PersianWords.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Persia.Net.Words; +namespace Persia.Net; internal static class PersianWords {