SheetXL - v0.3.20
    Preparing search index...

    Interface IteratorContext

    Provides access to cell-specific information and utility functions during range iteration.

    This object serves as a context in the iterator, offering a convenient way to retrieve the cell's coordinates, the full ICell object, and perform additional operations like converting values to JavaScript dates or getting the cell's address.

    interface IteratorContext {
        getA1(coords?: Partial<IRange.FixableCellCoords>): string;
        getCell(): ICell;
        getCoords(): IRange.CellCoords;
        getType(): ScalarType;
        toJSDate(value?: number): Date;
    }
    Index

    Methods

    • Converts the given or current cell coordinates to their corresponding A1-style address string (e.g., 'A1').

      Parameters

      • Optionalcoords: Partial<IRange.FixableCellCoords>

        The coordinates to convert. If not provided, the coordinates of the current cell in the iteration will be used.

      Returns string

      The A1-style address string representing the cell coordinates.

      The returned address can be used for further range queries or operations within the spreadsheet.

    • Retrieves the ICell associated with the current iteration.

      Returns ICell

      ICells are dynamically created and are significantly slower to access than simple values.

    • Convert the current value to a Javascript Date object, considering the containers's 1904 date system setting.

      Parameters

      • Optionalvalue: number

      Returns Date

      A JavaScript Date object representing the converted date, or null if the value is not a valid date (< 0 or greater than December 31, 9999).

      Spreadsheets store dates internally as serial numbers (OADates) to optimize calculation performance. These are integer values representing the number of days since either January 1, 1900, or January 1, 1904, depending on the container's settings.

      For type-safe date retrieval consider using the ICell.toDate method, which returns null if the cell value is not a valid date.

      Refer to the following resources for more details: Date systems in Excel DateTime.ToOADate Method