Skip to content

Files

Latest commit

 

History

History
 
 

moment

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

cljsjs/moment

[cljsjs/moment "2.24.0-0"] ;; latest release

This jar comes with deps.cljs as used by the Foreign Libs feature of the ClojureScript compiler. After adding the above dependency to your project you can require the packaged library like so:

(ns application.core
  (:require cljsjs.moment))

(console.log (.format (js/moment)))

This package also supports :global-exports:

(ns application.core
  (:require [moment :as moment]))

(console.log (.format (moment.)))

Locales

Each locale from Moment.js is provided as separate foreign dependency namespace. You should be able to set Moment to use locales if you first require them.

(ns application.core
  (:require cljsjs.moment cljsjs.moment.locale.fi))

(.locale js/moment "fi")

You can also use the following syntax:

(ns application.core
  (:require [moment :as moment]
            [moment.locale.fi]))

(.locale moment "fi")