/// <summary> Sees if the extended formatting record at the specified position /// represents a date. First checks against the built in formats, and /// then checks against the hash map of FormatRecords /// /// </summary> /// <param name="pos">the xf format index /// </param> /// <returns> TRUE if this format index is formatted as a Date /// </returns> public bool isDate(int pos) { XFRecord xfr = (XFRecord)xfRecords[pos]; if (xfr.isDate()) { return(true); } FormatRecord fr = (FormatRecord)formats[xfr.FormatRecord]; return(fr == null?false:fr.Date); }
/// <summary> Gets the DateFormat used to format the cell. /// /// </summary> /// <param name="pos">the xf format index /// </param> /// <returns> the DateFormat object used to format the date in the original /// excel cell /// </returns> public DateTimeFormatInfo getDateFormat(int pos) { XFRecord xfr = (XFRecord)xfRecords[pos]; if (xfr.isDate()) { return(xfr.DateFormat); } FormatRecord fr = (FormatRecord)formats[xfr.FormatRecord]; if (fr == null) { return(null); } return(fr.Date?fr.DateFormat:null); }