DisplayCalendar Method (Moment, Moment) |
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,
Moment compareMoment
)
<ExtensionAttribute>
Public Shared Function Calendar (
moment As Moment,
compareMoment As Moment
) As String
public:
[ExtensionAttribute]
static String^ Calendar(
Moment^ moment,
Moment^ compareMoment
)
[<ExtensionAttribute>]
static member Calendar :
moment : Moment *
compareMoment : Moment -> string
Parameters
- moment
- Type: MomentSharpMoment
Moment - compareMoment
- Type: MomentSharpMoment
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