Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up templates #1311

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
348 changes: 149 additions & 199 deletions src/Humanizer/FluentDate/In.Months.cs
Original file line number Diff line number Diff line change
@@ -1,201 +1,151 @@

using System;
using System;

namespace Humanizer
namespace Humanizer;

public partial class In
{
public partial class In
{

/// <summary>
/// Returns 1st of January of the current year
/// </summary>
public static DateTime January
{
get { return new DateTime(DateTime.UtcNow.Year, 1, 1); }
}

/// <summary>
/// Returns 1st of January of the year passed in
/// </summary>
public static DateTime JanuaryOf(int year)
{
return new DateTime(year, 1, 1);
}

/// <summary>
/// Returns 1st of February of the current year
/// </summary>
public static DateTime February
{
get { return new DateTime(DateTime.UtcNow.Year, 2, 1); }
}

/// <summary>
/// Returns 1st of February of the year passed in
/// </summary>
public static DateTime FebruaryOf(int year)
{
return new DateTime(year, 2, 1);
}

/// <summary>
/// Returns 1st of March of the current year
/// </summary>
public static DateTime March
{
get { return new DateTime(DateTime.UtcNow.Year, 3, 1); }
}

/// <summary>
/// Returns 1st of March of the year passed in
/// </summary>
public static DateTime MarchOf(int year)
{
return new DateTime(year, 3, 1);
}

/// <summary>
/// Returns 1st of April of the current year
/// </summary>
public static DateTime April
{
get { return new DateTime(DateTime.UtcNow.Year, 4, 1); }
}

/// <summary>
/// Returns 1st of April of the year passed in
/// </summary>
public static DateTime AprilOf(int year)
{
return new DateTime(year, 4, 1);
}

/// <summary>
/// Returns 1st of May of the current year
/// </summary>
public static DateTime May
{
get { return new DateTime(DateTime.UtcNow.Year, 5, 1); }
}

/// <summary>
/// Returns 1st of May of the year passed in
/// </summary>
public static DateTime MayOf(int year)
{
return new DateTime(year, 5, 1);
}

/// <summary>
/// Returns 1st of June of the current year
/// </summary>
public static DateTime June
{
get { return new DateTime(DateTime.UtcNow.Year, 6, 1); }
}

/// <summary>
/// Returns 1st of June of the year passed in
/// </summary>
public static DateTime JuneOf(int year)
{
return new DateTime(year, 6, 1);
}

/// <summary>
/// Returns 1st of July of the current year
/// </summary>
public static DateTime July
{
get { return new DateTime(DateTime.UtcNow.Year, 7, 1); }
}

/// <summary>
/// Returns 1st of July of the year passed in
/// </summary>
public static DateTime JulyOf(int year)
{
return new DateTime(year, 7, 1);
}

/// <summary>
/// Returns 1st of August of the current year
/// </summary>
public static DateTime August
{
get { return new DateTime(DateTime.UtcNow.Year, 8, 1); }
}

/// <summary>
/// Returns 1st of August of the year passed in
/// </summary>
public static DateTime AugustOf(int year)
{
return new DateTime(year, 8, 1);
}

/// <summary>
/// Returns 1st of September of the current year
/// </summary>
public static DateTime September
{
get { return new DateTime(DateTime.UtcNow.Year, 9, 1); }
}

/// <summary>
/// Returns 1st of September of the year passed in
/// </summary>
public static DateTime SeptemberOf(int year)
{
return new DateTime(year, 9, 1);
}

/// <summary>
/// Returns 1st of October of the current year
/// </summary>
public static DateTime October
{
get { return new DateTime(DateTime.UtcNow.Year, 10, 1); }
}

/// <summary>
/// Returns 1st of October of the year passed in
/// </summary>
public static DateTime OctoberOf(int year)
{
return new DateTime(year, 10, 1);
}

/// <summary>
/// Returns 1st of November of the current year
/// </summary>
public static DateTime November
{
get { return new DateTime(DateTime.UtcNow.Year, 11, 1); }
}

/// <summary>
/// Returns 1st of November of the year passed in
/// </summary>
public static DateTime NovemberOf(int year)
{
return new DateTime(year, 11, 1);
}

/// <summary>
/// Returns 1st of December of the current year
/// </summary>
public static DateTime December
{
get { return new DateTime(DateTime.UtcNow.Year, 12, 1); }
}

/// <summary>
/// Returns 1st of December of the year passed in
/// </summary>
public static DateTime DecemberOf(int year)
{
return new DateTime(year, 12, 1);
}
}
}
/// <summary>
/// Returns 1st of January of the current year
/// </summary>
public static DateTime January
=> new(DateTime.UtcNow.Year, 1, 1);

/// <summary>
/// Returns 1st of January of the year passed in
/// </summary>
public static DateTime JanuaryOf(int year)
=> new(year, 1, 1);

/// <summary>
/// Returns 1st of February of the current year
/// </summary>
public static DateTime February
=> new(DateTime.UtcNow.Year, 2, 1);

/// <summary>
/// Returns 1st of February of the year passed in
/// </summary>
public static DateTime FebruaryOf(int year)
=> new(year, 2, 1);

/// <summary>
/// Returns 1st of March of the current year
/// </summary>
public static DateTime March
=> new(DateTime.UtcNow.Year, 3, 1);

/// <summary>
/// Returns 1st of March of the year passed in
/// </summary>
public static DateTime MarchOf(int year)
=> new(year, 3, 1);

/// <summary>
/// Returns 1st of April of the current year
/// </summary>
public static DateTime April
=> new(DateTime.UtcNow.Year, 4, 1);

/// <summary>
/// Returns 1st of April of the year passed in
/// </summary>
public static DateTime AprilOf(int year)
=> new(year, 4, 1);

/// <summary>
/// Returns 1st of May of the current year
/// </summary>
public static DateTime May
=> new(DateTime.UtcNow.Year, 5, 1);

/// <summary>
/// Returns 1st of May of the year passed in
/// </summary>
public static DateTime MayOf(int year)
=> new(year, 5, 1);

/// <summary>
/// Returns 1st of June of the current year
/// </summary>
public static DateTime June
=> new(DateTime.UtcNow.Year, 6, 1);

/// <summary>
/// Returns 1st of June of the year passed in
/// </summary>
public static DateTime JuneOf(int year)
=> new(year, 6, 1);

/// <summary>
/// Returns 1st of July of the current year
/// </summary>
public static DateTime July
=> new(DateTime.UtcNow.Year, 7, 1);

/// <summary>
/// Returns 1st of July of the year passed in
/// </summary>
public static DateTime JulyOf(int year)
=> new(year, 7, 1);

/// <summary>
/// Returns 1st of August of the current year
/// </summary>
public static DateTime August
=> new(DateTime.UtcNow.Year, 8, 1);

/// <summary>
/// Returns 1st of August of the year passed in
/// </summary>
public static DateTime AugustOf(int year)
=> new(year, 8, 1);

/// <summary>
/// Returns 1st of September of the current year
/// </summary>
public static DateTime September
=> new(DateTime.UtcNow.Year, 9, 1);

/// <summary>
/// Returns 1st of September of the year passed in
/// </summary>
public static DateTime SeptemberOf(int year)
=> new(year, 9, 1);

/// <summary>
/// Returns 1st of October of the current year
/// </summary>
public static DateTime October
=> new(DateTime.UtcNow.Year, 10, 1);

/// <summary>
/// Returns 1st of October of the year passed in
/// </summary>
public static DateTime OctoberOf(int year)
=> new(year, 10, 1);

/// <summary>
/// Returns 1st of November of the current year
/// </summary>
public static DateTime November
=> new(DateTime.UtcNow.Year, 11, 1);

/// <summary>
/// Returns 1st of November of the year passed in
/// </summary>
public static DateTime NovemberOf(int year)
=> new(year, 11, 1);

/// <summary>
/// Returns 1st of December of the current year
/// </summary>
public static DateTime December
=> new(DateTime.UtcNow.Year, 12, 1);

/// <summary>
/// Returns 1st of December of the year passed in
/// </summary>
public static DateTime DecemberOf(int year)
=> new(year, 12, 1);

}
Loading