Created
April 23, 2016 14:42
-
-
Save greenygh0st/30e40704aed2cc65ed8aa76de5426309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace Generic.Helpers | |
{ | |
public static class DateTimerGreaterThan | |
{ | |
/// <summary> | |
/// Is the first date greater than the second date? | |
/// </summary> | |
/// <param name="md"></param> | |
/// <param name="d1"></param> | |
/// <param name="d2"></param> | |
/// <returns>Bool</returns> | |
public static bool GreaterThan (this DateTime md, DateTime d1) | |
{ | |
var r = DateTime.Compare(md, d1); | |
if (r == 1) | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
public static bool GreaterThan(this DateTime? md, DateTime d1) | |
{ | |
var r = DateTime.Compare((DateTime)md, d1); | |
if (r == 1) | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment