Skip to content

[Readme improvement] Misleading README docs about date formatting using ClojureScript #34

@ychenz

Description

@ychenz

Hi team!

I am pretty new to ClojureScript and developing using Shadow-cljs and Reframe. The part of README that explains how to format date using the translate function works fine only when plain strings are passed, but it will throw a compilation error as soon as the plain string is replaced with a variable:

Here is what's mentioned in the README

(translate :en :date-full     #inst "2016-01-01T15:00:00") ;; => "January 1, 2016"
(translate :en :date-short    #inst "2016-01-01T15:00:00") ;; => "1/1/16"
(translate :en :time-military #inst "2016-01-01T15:00:00") ;; => "1500"

Here is the error screenshot:
image

The error is resolved when I replaced #inst <string-var> with (js/Date. <string-var>). I'm just thinking maybe it is better to mention this in the README so it will be easier for new developers to use this library.

Thank you!
Yuchen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions