C# Class Shared.Helpers

Show file Open project: sealuzh/PersonalAnalytics

Public Methods

Method Description
DateTimeFromJavascriptTimestamp ( long date ) : System.DateTime
FirstLetterToUpper ( string str ) : string

Makes every string's first letter upper case the rest lower case

GetIso8601WeekOfYear ( System.DateTime time ) : int

This presumes that weeks start with Monday. Week 1 is the 1st week of the year with a Thursday in it. see: http://stackoverflow.com/questions/11154673/get-the-correct-week-number-of-a-given-date

JavascriptTimestampFromDateTime ( System.DateTime date ) : long

JavaScript Timestamp from C# DateTime

RoundUp ( System.DateTime dt, System.TimeSpan d ) : System.DateTime

Rounds up a time (e.g. 10minutes)

Method Details

DateTimeFromJavascriptTimestamp() public static method

public static DateTimeFromJavascriptTimestamp ( long date ) : System.DateTime
date long
return System.DateTime

FirstLetterToUpper() public static method

Makes every string's first letter upper case the rest lower case
public static FirstLetterToUpper ( string str ) : string
str string
return string

GetIso8601WeekOfYear() public static method

This presumes that weeks start with Monday. Week 1 is the 1st week of the year with a Thursday in it. see: http://stackoverflow.com/questions/11154673/get-the-correct-week-number-of-a-given-date
public static GetIso8601WeekOfYear ( System.DateTime time ) : int
time System.DateTime
return int

JavascriptTimestampFromDateTime() public static method

JavaScript Timestamp from C# DateTime
public static JavascriptTimestampFromDateTime ( System.DateTime date ) : long
date System.DateTime
return long

RoundUp() public static method

Rounds up a time (e.g. 10minutes)
public static RoundUp ( System.DateTime dt, System.TimeSpan d ) : System.DateTime
dt System.DateTime
d System.TimeSpan
return System.DateTime