C# Class Castle.MonoRail.Framework.Helpers.DateFormatHelper

Simple helper for date formatting
Inheritance: AbstractHelper
显示文件 Open project: nats/castle-1.0.3-mono Class Usage Examples

Public Methods

Method Description
AlternativeFriendlyFormatFromNow ( System.DateTime date ) : String

Alternative representation of a difference between the specified date and now. If within 24hr it returns Today. If within 48hr it returns Yesterday. If within 40 days it returns x days ago and otherwise it returns x months ago

TODO: Think about i18n

FriendlyFormatFromNow ( System.DateTime date ) : String

Returns the difference from the specified date the the current date in a friendly string like "1 day ago"

TODO: Think about i18n

ToShortDate ( System.DateTime date ) : String

Formats to short date

ToShortDateTime ( System.DateTime date ) : String

Formats to short date

Method Details

AlternativeFriendlyFormatFromNow() public method

Alternative representation of a difference between the specified date and now. If within 24hr it returns Today. If within 48hr it returns Yesterday. If within 40 days it returns x days ago and otherwise it returns x months ago

TODO: Think about i18n

public AlternativeFriendlyFormatFromNow ( System.DateTime date ) : String
date System.DateTime The date in the past (should be equal or less than now)
return String

FriendlyFormatFromNow() public method

Returns the difference from the specified date the the current date in a friendly string like "1 day ago"

TODO: Think about i18n

public FriendlyFormatFromNow ( System.DateTime date ) : String
date System.DateTime The date in the past (should be equal or less than now)
return String

ToShortDate() public method

Formats to short date
public ToShortDate ( System.DateTime date ) : String
date System.DateTime
return String

ToShortDateTime() public method

Formats to short date
public ToShortDateTime ( System.DateTime date ) : String
date System.DateTime
return String