SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface DateOptions

    Adds additional fill options for Dates.

    interface DateOptions {
        date1904?: boolean;
        hasDifferentAdjacentFill?: boolean;
        hasSameTypeAdjacentFill?: boolean;
        monthEnd?: boolean;
        multiFill?: boolean;
        reverse?: boolean;
        stepValue?: number;
        stopValue?: number;
        trend?: boolean;
        types?: readonly InteropScalarType[];
        unit?: DateUtils.DateUnit;
    }

    Hierarchy (View Summary)

    Index
    date1904?: boolean

    Whether serial dates in values are on the 1904 epoch.

    false
    
    hasDifferentAdjacentFill?: boolean

    Indicates whether there is adjacent span with a different fill type.

    • Purpose: This flag allows Fillers to adjust their behavior based on the presence of adjacent fills. For instance, a numeric Filler might increment by 1 when there's an adjacent fill, but simply copy the value otherwise.
    hasSameTypeAdjacentFill?: boolean

    Indicates whether there is adjacent span with the same fill type.

    monthEnd?: boolean

    Land every filled value on the last day of its month, rather than keeping the template's day-of-month.

    false — but a template whose values are ALL month ends is read as a month-end
    series anyway, so this is only needed to force one.
    `Jan 15` with `{ unit: Month, monthEnd: true }` fills `Jan 31, Feb 28, Mar 31` where the
    plain month fill gives `Feb 15, Mar 15`.
    multiFill?: boolean

    Indicates whether there is another fill operation being performed in the same series.

    reverse?: boolean

    Indicates whether the fill operation is in reverse order.

    If in reverse order the createFill fill be given values in reverse order. This flag is only needed if there is a single value.

    stepValue?: number

    The increment between values, replacing the one the template implies.

    The step read from the existing values.
    
    • What a step MEANS is the filler's own: an addend for a linear series, a RATIO for a growth one, a count of whatever unit a date type names. The value is passed through uninterpreted, so only offer the field where Filler.supportsStep says to.
    • It counts from the LAST value of the template, not the first — an outright step replaces the series the template implies rather than re-deriving it, so 1, 5 stepping by 2 continues 7, 9, 11 instead of restarting 3, 5, 7 over a 5 already on the sheet. A one-value template makes this the first value, which is what Excel's Series dialog does with any selection.
    `1` with `stepValue: 2` fills `3, 5, 7`; with `stepValue: -2` it fills `-1, -3, -5`.
    
    stopValue?: number

    The value at which the series stops.

    Unbounded — the fill covers the whole destination.
    
    • Cells past the stop are left blank, not clamped to it.
    • "Past" is judged in the direction the series travels, which comes from the series and not from the sign of the stop. A stop sitting BEHIND the travel ends it at once and fills nothing — 1 stepping by 2 toward a stop of -5.
    `1` with `stepValue: 2, stopValue: 7` fills `3, 5, 7` and then blanks.
    
    trend?: boolean

    Fit the series to the template rather than stepping from it — a least-squares line for AutoFill.Linear, and the same fit on the logs for AutoFill.Growth.

    false — the series is stepped.
    
    • A fit is over the WHOLE template at the values' own positions, so it needs at least two of them and a filler that cannot manage one declines (leaving the caller to repeat the template). Preset.minValues carries that arity where a fill is offered.
    • stepValue and stopValue mean nothing to a fit and are ignored — an authoring surface should hide both while this is on, which is what Excel's Series dialog does with them.
    • Only offer the field where Filler.supportsTrend says to.
    `1, 2, 4` fills `5.33, 6.83, 8.33` linearly, and `8, 16, 32` as a growth trend.
    
    types?: readonly InteropScalarType[]

    The type of each value, parallel to the values being filled.

    • Supplied by the caller because the runtime type cannot always answer it: a date is a serial NUMBER, and only the cell's number format says so.
    • When omitted the type is read off each value instead, which is right for everything but dates.

    The unit each step counts, which is what makes a named date fill its own type.

    Read off the template, LARGEST unit first — years, month ends, months,
    weekdays, then the serial's own arithmetic (days, or hours for a bare time).

    DateUnit.Weekday is only ever read off a template that a plain day series can NOT explain: Mon, Tue, Wed is a one-day step, and so is Fri, Mon — Excel's three days — because two dates are always a plain step apart. Fri, Mon, Tue has no such reading and is a business-day series.