![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
backbone-moment
Advanced tools
This plugin modifies Backbone.Model adding a convenient getter/setter for date attributes using moment.js
var myModel = new Backbone.Model();
var fooDate = moment('1997-1-1');
myModel.setMoment('fooDate', fooDate, { silent: true });
myModel.get('fooDate'); // returns "1997-01-01T06:00:00+00:00"
moment.isMoment(myModel.getMoment('fooDate')); // is true
// [http://momentjs.com/docs/#/query/is-same/](http://momentjs.com/docs/#/query/is-same/)
myModel.getMoment('fooDate').isSame(fooDate); // is true
Additionally you can use the shorthand moment for getting and setting
var fooDate = moment('1997-1-1');
myModel.moment('fooDate', fooDate, { silent: true });
myModel.moment('fooDate').isSame(fooDate); // is true
You can clear a moment by setting undefined
, null
, or ````
myModel.moment('fooDate', undefined);
myModel.moment('fooDate'); // returns undefined
Backbone.__moment
is a reference to moment.
If you have a modified or specially loaded moment, you will need to shim in a copy.
require('backbone-moment');
Backbone.__moment = require('my-moment');
By default backbone-moment
stores dates as UTC strings
Override Backbone.Model.formatMoment
if you need to change this behavior
var MyModel = Backbone.Model.extend({
formatMoment: function(attr, date){
return Backbone.__moment(date).utc().format();
}
});
You can download the latest builds directly from the dist folder above.
Via npm
$ npm install backbone-moment
Via bower
$ bower install backbone-moment
Currently Backbone-moment is available via npm and bower. If you would like add it to another channel, please open an issue.
For change logs and release notes, see the changelog file.
Backbone-moment supports IE8+ and modern browsers.
Report issues with Backbone-moment, and submit pull requests to fix problems or to create summarized and documented feature requests (preferably with the feature implemented in the pull request).
===
This library is © 2015 Paul Falgout. Distributed under MIT license.
FAQs
Adds a moment.js getter/setter to Backbone.Model
The npm package backbone-moment receives a total of 0 weekly downloads. As such, backbone-moment popularity was classified as not popular.
We found that backbone-moment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.