Moment.js has the ability to accept javascript Date objects as parameters (documented here), and it would be great if the API of these bindings supported this. As far as I'm aware the only library that wraps the javascript date object is purescript-datetime (well at least according my quick search of bower anyways), so my thinking it would only be natural to add a parseDate function to this library that looked something like this.
import Data.Date
--
-- may want to double check this...
--
foreign import parseDate """
function parseDate(date) {
return moment({ unit: date });
}
""" :: Date -> Moment
Date in purescript-datetime, is just a new type wrapper of the 'native' javascript date object, so you could just pass it to moment.js like so.
But it would come at the cost of adding an additional dependency to this library, and I'm not sure how big of a deal this is in purescript. Thoughts?
Moment.js has the ability to accept javascript Date objects as parameters (documented here), and it would be great if the API of these bindings supported this. As far as I'm aware the only library that wraps the javascript date object is
purescript-datetime(well at least according my quick search of bower anyways), so my thinking it would only be natural to add aparseDatefunction to this library that looked something like this.Date in
purescript-datetime, is just a new type wrapper of the 'native' javascript date object, so you could just pass it to moment.js like so.But it would come at the cost of adding an additional dependency to this library, and I'm not sure how big of a deal this is in purescript. Thoughts?