Skip to content

TextUtils.formatDate: take DateFormat not DisplayOptions #228

@s-leroux

Description

@s-leroux

TextUtils.formatDate takes DisplayOptions but is a low-level helper; pulling date.format from broad options couples date rendering to global display config.

Location: src/displayable.mts:350

Code:

// XXX formatDate is a low-level function that should take DateFormat as argument, not DisplayOptions

Possible approach: Split API: formatDate(date: Date | number, format: DateFormat) and keep a thin wrapper for DisplayOptions at call sites that need it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need changeBreaking change. Enhance or modify the current implementation in an observable way.qualityCross-cutting polish; eventually pair with another work-type labelquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions