Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RFC: Seperate Date and Time format functions #71

Copy link
Copy link
@hexagonal-sun

Description

@hexagonal-sun
Issue body actions

Hi,

It would be nice if functions for formatting Date and Time types exist. Currently, if one wants to format a Date, a dummy Time value needs to be be created to convert to a DateTime for formatting; likewise for the Time type.

I'm not exactly sure what the best way to do this would be. Maybe:

data PlacholderFormatterCommand = Placeholder String

data DateFormatterCommand
  = YearFull
  | YearTwoDigits
  | YearAbsolute
  | MonthFull
    [...]
  | PlaceholderFormatterCommand

data TimeFormatterCommand
  = [...]
  | PlaceholderFormatterCommand

data DateTimeFormatterCommand
  = DateFormatterCommand
  | TimeFormatterCommand

The main issue I see with this approach are FormatterCommands that are applicable to both Dates and Times, namely Placeholder and UnixTimestamp. Maybe there is a more elegant solution involving type classes?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.