Skip to content

Commit

Permalink
Merge pull request #10 from shahabfar/release
Browse files Browse the repository at this point in the history
Changing the namespaces
  • Loading branch information
shahabfar committed Mar 23, 2024
2 parents 548c19c + c8d0a4b commit eba2008
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 23 deletions.
4 changes: 1 addition & 3 deletions src/Persia.Net.Test/PersianDateTimeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Persia.Net.DateTimes;

namespace Persia.Net.Test
namespace Persia.Net.Test
{
public class PersianDateTimeTests
{
Expand Down
2 changes: 1 addition & 1 deletion src/Persia.Net/Constants/CalendarConstants.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Persia.Net.Constants;
namespace Persia.Net;

internal class CalendarConstants
{
Expand Down
2 changes: 1 addition & 1 deletion src/Persia.Net/Constants/PersianCalendarConstants.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Persia.Net.Constants;
namespace Persia.Net;

public class PersianCalendarConstants
{
Expand Down
4 changes: 2 additions & 2 deletions src/Persia.Net/DateTimes/Converter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Persia.Net.DateTimes;
namespace Persia.Net;

using static Constants.CalendarConstants;
using static CalendarConstants;

internal static class Converter
{
Expand Down
5 changes: 2 additions & 3 deletions src/Persia.Net/DateTimes/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
13 changes: 10 additions & 3 deletions src/Persia.Net/DateTimes/NullableDateTimeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Persia.Net.Enums;

namespace Persia.Net.DateTimes;

namespace Persia.Net;

public static class NullableDateTimeExtensions
{
Expand Down Expand Up @@ -154,6 +153,14 @@ public static PersianDateTime[] NextPersianMonth(this DateTime? date)
return date.Value.NextPersianMonth();
}

/// <summary>
/// Calculates the dates of the Previous Persian month for a given date.
/// </summary>
/// <param name="date">The date for which to calculate the Previous Persian month. If null, an ArgumentNullException is thrown.</param>
/// <returns>An array of <see cref="PersianDateTime"/> objects representing each day of the Previous Persian month.</returns>
/// <remarks>
/// This method first converts the given date to a Persian date. It then creates a new <see cref="PersianDateTime"/> for each day of the Previous month, starting from the first day of the Previous month.
/// </remarks>
public static PersianDateTime[] PreviousPersianMonth(this DateTime? date)
{
if (!date.HasValue)
Expand Down
2 changes: 1 addition & 1 deletion src/Persia.Net/DateTimes/PersianDateOnly.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Persia.Net.DateTimes;
namespace Persia.Net;

public class PersianDateOnly(int year, int month, int day)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Persia.Net/DateTimes/PersianDateTime.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down Expand Up @@ -378,7 +378,7 @@ public PersianDateTime AddMonths(int months)
/// <summary>
/// Converts the specified string representation of a date to its PersianDateTime equivalent.
/// </summary>
/// <param name="date">A string containing a date to convert.</param>
/// <param name="date">A string containing a date to convert. Expected format is 'yyyy/MM/dd'.</param>
/// <param name="systemClock">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.</param>
/// <returns>
/// A PersianDateTime equivalent to the date contained in the input string.
Expand All @@ -402,7 +402,7 @@ public static PersianDateTime Parse(string date, bool systemClock = false)
/// <summary>
/// Tries to convert the specified string representation of a date to its PersianDateTime equivalent, and returns a value that indicates whether the conversion succeeded.
/// </summary>
/// <param name="date">A string containing a date to convert.</param>
/// <param name="date">A string containing a date to convert. Expected format is 'yyyy/MM/dd'.</param>
/// <param name="result">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.</param>
/// <param name="systemClock">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.</param>
/// <returns>
Expand Down
2 changes: 1 addition & 1 deletion src/Persia.Net/DateTimes/PersianDateTimeComparable.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Persia.Net.DateTimes;
namespace Persia.Net;

public partial class PersianDateTime : IEquatable<PersianDateTime>, IComparable<PersianDateTime>
{
Expand Down
2 changes: 1 addition & 1 deletion src/Persia.Net/Enums/TimeUnit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Persia.Net.Enums;
namespace Persia.Net;

public enum TimeUnit
{
Expand Down
2 changes: 1 addition & 1 deletion src/Persia.Net/Words/PersianWords.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text;

namespace Persia.Net.Words;
namespace Persia.Net;

internal static class PersianWords
{
Expand Down

0 comments on commit eba2008

Please sign in to comment.