public static DateTime?DateTimeValue(this TimeField field, DateField dateField) { if (dateField == null) { return(null); } var dateNull = dateField.DateTimeValue(); if (dateNull == null) { return(null); } var date = (DateTime)dateNull; var str = field.Text; if (string.IsNullOrWhiteSpace(str)) { return(date.Date); } var result = date; str = date.ToString("yyyy-MM-dd") + " " + str.Trim(); if (DateTime.TryParse(str, out result)) { return(result); } return(date.Date); }
public static string StringValue(this DateField field, DateTime defaultValue, int addDays) { var dtime = field.DateTimeValue(defaultValue, addDays); if (dtime == null) { return(null); } return(DateTimeStringValue((DateTime)dtime)); }
public static DateTime DateTimeValue(this DateField field, DateTime defaultValue, int addDays) { var dtime = field.DateTimeValue(); if (dtime == null) { if (defaultValue != null) { return(defaultValue.AddDays(addDays)); } } return(((DateTime)dtime).AddDays(addDays)); }
public static DateTime DateTimeValue(this DateField field, DateTime defaultValue) { return(field.DateTimeValue(defaultValue, 0)); }
public static DateTime?DateTimeValue(this DateField field) { return(field.DateTimeValue(0)); }