Socket
Socket
Sign inDemoInstall

ractive-datetime

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ractive-datetime - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

test/ractive-datetime.spec.js

4

package.json
{
"name": "ractive-datetime",
"version": "0.1.1",
"version": "1.0.0",
"main": "ractive-datetime.js",

@@ -16,3 +16,3 @@ "keywords": [

"dependencies": {
"moment": "^2.11.2",
"fecha": "^2.2.0",
"ractive": "^0.7.3"

@@ -19,0 +19,0 @@ },

/*
* Formats a date using the specified format.
*/
var moment = require('moment');
var fecha = require('fecha');
function datetime(date, format) {
return moment(date).format(format);
return fecha.format(date, format);
}
function fromNow(date) {
return moment(date).fromNow();
}
// Self-registering in Ractive:

@@ -20,3 +16,2 @@

helpers.datetime = datetime;
helpers.fromNow = fromNow;

@@ -26,4 +21,3 @@ // Exporting for testing:

module.exports = {
datetime: datetime,
fromNow: fromNow
datetime: datetime
}
# Ractive Date/Time helper
A date and time format mustache helper for [Ractive](http://www.ractivejs.org/),
using [Moment.js](http://momentjs.com/)
using [fecha](https://github.com/taylorhakes/fecha)

@@ -40,12 +40,7 @@ ----

Full format options are [here](http://momentjs.com/docs/#/displaying/format/).
Full format options are [here](https://github.com/taylorhakes/fecha#formatting-tokens).
----
**Note: Relative dates using `fromNow` helper have been removed in version 1.x. to reduce dependency sizes.**
If you need this, please use the older 0.1.x versions:
### Relative dates:
<h2>{{fromNow(some_past_date)}}</h2>
#### Outputs:
7 months ago
`npm install ractive-datetime@0.1`

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc