DisplayCalendar Method (Moment, DateTime) |
Will format a date with different strings depending on how close to referenceTime's date (today by default) the
date is.
Emulates: http://momentjs.com/docs/#/displaying/calendar-time/
Namespace: MomentSharpAssembly: MomentSharp (in MomentSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static string Calendar(
this Moment moment,
DateTime dateTime = null
)
<ExtensionAttribute>
Public Shared Function Calendar (
moment As Moment,
Optional dateTime As DateTime = Nothing
) As String
public:
[ExtensionAttribute]
static String^ Calendar(
Moment^ moment,
DateTime dateTime = nullptr
)
[<ExtensionAttribute>]
static member Calendar :
moment : Moment *
?dateTime : DateTime
(* Defaults:
let _dateTime = defaultArg dateTime null
*)
-> string
Parameters
- moment
- Type: MomentSharpMoment
Moment - dateTime (Optional)
- Type: SystemDateTime
Uses DateTime.UtcNow if not provided
Return Value
Type:
StringLocalized string
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Moment. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also