| | 1 | | namespace Songhay.Extensions; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Extensions of <see cref="DateTime"/>. |
| | 5 | | /// </summary> |
| | 6 | | /// <remarks> |
| | 7 | | /// From Jon Skeet’s Miscellaneous Utility Library |
| | 8 | | /// Copyright (c) 2004-2008 Jon Skeet and Marc Gravell. |
| | 9 | | /// All rights reserved. |
| | 10 | | /// [http://www.pobox.com/~skeet/csharp/miscutil] |
| | 11 | | /// </remarks> |
| | 12 | | public static partial class DateTimeExtensions |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Returns a DateTime representing the specified day in January |
| | 16 | | /// in the specified year. |
| | 17 | | /// </summary> |
| 0 | 18 | | public static DateTime January(this int day, int year) => new DateTime(year, 1, day); |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Returns a DateTime representing the specified day in February |
| | 22 | | /// in the specified year. |
| | 23 | | /// </summary> |
| 0 | 24 | | public static DateTime February(this int day, int year) => new DateTime(year, 2, day); |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Returns a DateTime representing the specified day in March |
| | 28 | | /// in the specified year. |
| | 29 | | /// </summary> |
| 0 | 30 | | public static DateTime March(this int day, int year) => new DateTime(year, 3, day); |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Returns a DateTime representing the specified day in April |
| | 34 | | /// in the specified year. |
| | 35 | | /// </summary> |
| 0 | 36 | | public static DateTime April(this int day, int year) => new DateTime(year, 4, day); |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Returns a DateTime representing the specified day in May |
| | 40 | | /// in the specified year. |
| | 41 | | /// </summary> |
| 0 | 42 | | public static DateTime May(this int day, int year) => new DateTime(year, 5, day); |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Returns a DateTime representing the specified day in June |
| | 46 | | /// in the specified year. |
| | 47 | | /// </summary> |
| 0 | 48 | | public static DateTime June(this int day, int year) => new DateTime(year, 6, day); |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// Returns a DateTime representing the specified day in July |
| | 52 | | /// in the specified year. |
| | 53 | | /// </summary> |
| 0 | 54 | | public static DateTime July(this int day, int year) => new DateTime(year, 7, day); |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Returns a DateTime representing the specified day in August |
| | 58 | | /// in the specified year. |
| | 59 | | /// </summary> |
| 0 | 60 | | public static DateTime August(this int day, int year) => new DateTime(year, 8, day); |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Returns a DateTime representing the specified day in September |
| | 64 | | /// in the specified year. |
| | 65 | | /// </summary> |
| 0 | 66 | | public static DateTime September(this int day, int year) => new DateTime(year, 9, day); |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Returns a DateTime representing the specified day in October |
| | 70 | | /// in the specified year. |
| | 71 | | /// </summary> |
| 0 | 72 | | public static DateTime October(this int day, int year) => new DateTime(year, 10, day); |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// Returns a DateTime representing the specified day in November |
| | 76 | | /// in the specified year. |
| | 77 | | /// </summary> |
| 0 | 78 | | public static DateTime November(this int day, int year) => new DateTime(year, 11, day); |
| | 79 | |
|
| | 80 | | /// <summary> |
| | 81 | | /// Returns a DateTime representing the specified day in December |
| | 82 | | /// in the specified year. |
| | 83 | | /// </summary> |
| 0 | 84 | | public static DateTime December(this int day, int year) => new DateTime(year, 12, day); |
| | 85 | | } |