Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backgrid-moment-cell

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

backgrid-moment-cell - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

10

backgrid-moment-cell.js

@@ -180,7 +180,13 @@ /*

var formatterDefaultKeys = _.keys(formatterDefaults);
var instanceAttrs = _.pick(this, formatterDefaultKeys);
var classAttrs = _.pick(this, formatterDefaultKeys);
var formatterOptions = _.pick(options, formatterDefaultKeys);
_.extend(this.formatter, formatterDefaults, instanceAttrs, formatterOptions);
// Priority of the options for the formatter, from highest to lowerest
// 1. MomentCell instance options
// 2. MomentCell class attributes
// 3. MomentFormatter defaults
// this.formatter will have been instantiated now
_.extend(this.formatter, formatterDefaults, classAttrs, formatterOptions);
this.editor = this.editor.extend({

@@ -187,0 +193,0 @@ attributes: _.extend({}, this.editor.prototype.attributes || this.editor.attributes || {}, {

8

backgrid-moment-cell.min.js

@@ -89,2 +89,8 @@ /*

*/
initialize:function(b){f.__super__.initialize.apply(this,arguments);var c=d.prototype.defaults,e=a.keys(c),g=a.pick(this,e),h=a.pick(b,e);a.extend(this.formatter,c,g,h),this.editor=this.editor.extend({attributes:a.extend({},this.editor.prototype.attributes||this.editor.attributes||{},{placeholder:this.formatter.displayFormat})})}});a.extend(f.prototype,d.prototype.defaults)});
initialize:function(b){f.__super__.initialize.apply(this,arguments);var c=d.prototype.defaults,e=a.keys(c),g=a.pick(this,e),h=a.pick(b,e);
// Priority of the options for the formatter, from highest to lowerest
// 1. MomentCell instance options
// 2. MomentCell class attributes
// 3. MomentFormatter defaults
// this.formatter will have been instantiated now
a.extend(this.formatter,c,g,h),this.editor=this.editor.extend({attributes:a.extend({},this.editor.prototype.attributes||this.editor.attributes||{},{placeholder:this.formatter.displayFormat})})}});a.extend(f.prototype,d.prototype.defaults)});
{
"name": "backgrid-moment-cell",
"version": "0.3.6",
"version": "0.3.7",
"description": "Backgrid.js datetime cell type formatted via moment.js.",

@@ -41,9 +41,9 @@ "main": "backgrid-moment-cell.js",

"karma-jasmine-html-reporter": "^0.2.0",
"karma-safari-launcher": "^0.1.1",
"underscore": "^1.8.3"
"karma-safari-launcher": "^0.1.1"
},
"dependencies": {
"backgrid": "~0.3.7",
"moment": "^2.12.0"
"moment": "^2.12.0",
"underscore": "^1.8.3"
}
}

@@ -215,2 +215,29 @@ /*

it("will accept formatter options set on the cell class", function () {
cell = new (Backgrid.Extension.MomentCell.extend({
displayLang: 'zh_HK'
}))({
column: {
name: "birthday",
cell: "moment"
},
model: book
});
expect(cell.formatter.displayLang).toBe('zh_HK');
});
it("will accept formatter options given to the cell constructor", function () {
cell = new Backgrid.Extension.MomentCell({
column: {
name: "birthday",
cell: "moment"
},
model: book,
displayLang: 'zh_HK'
});
expect(cell.formatter.displayLang).toBe('zh_HK');
});
it("applies a moment-cell class to the cell", function () {

@@ -217,0 +244,0 @@ expect(cell.render().$el.hasClass("moment-cell")).toBe(true);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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