public string DayName(string d, string culture) { try { var date = new DateTz(d); var ci = new CultureInfo(culture); return(ci.DateTimeFormat.GetDayName(date.D.DayOfWeek)); } catch (Exception) { return(""); } }
/// <summary> /// Implements the following function /// string date2:month-name(string, string?) /// See http://www.xmland.net/exslt/doc/GDNDatesAndTimes-month-name.xml /// </summary> /// <remarks>THIS FUNCTION IS NOT PART OF EXSLT!!!</remarks> /// <returns>The month name of the specified date according to /// specified culture or the empty string if the input date is invalid or /// the culture isn't supported.</returns> public string MonthName(string d, string culture) { try { DateTz date = new DateTz(d); CultureInfo ci = new CultureInfo(culture); return(ci.DateTimeFormat.GetMonthName(date.D.Month)); } catch (Exception) { return(""); } }
public string MonthAbbreviation(string d, string culture) { try { var date = new DateTz(d); var ci = new CultureInfo(culture); return(ci.DateTimeFormat.GetAbbreviatedMonthName(date.D.Month)); } catch (Exception) { return(""); } }
/// <summary> /// Implements the following function /// string date2:day-abbreviation(string, string) /// See http://www.xmland.net/exslt/doc/GDNDatesAndTimes-day-abbreviation.xml /// </summary> /// <remarks>THIS FUNCTION IS NOT PART OF EXSLT!!!</remarks> /// <returns>The abbreviated day name of the specified date according to /// specified culture or the empty string if the input date is invalid or /// the culture isn't supported.</returns> public string DayAbbreviation(string d, string culture) { try { DateTz date = new DateTz(d); CultureInfo ci = new CultureInfo(culture); return(ci.DateTimeFormat.GetAbbreviatedDayName(date.D.DayOfWeek)); } catch (Exception) { return(""); } }