var myModel = ;var fooDate = ;myModel;myModel; // returns "1997-01-01T06:00:00+00:00"moment; // is true// ()myModel; // is true
Additionally you can use the shorthand moment for getting and setting
var fooDate = ;myModel;myModel; // is true
You can clear a moment by setting
null, or ````
myModel;myModel; // 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.
;Backbone__moment = ;
backbone-moment stores dates as UTC strings
Backbone.Model.formatMoment if you need to change this behavior
var MyModel = BackboneModel;
You can download the latest builds directly from the dist folder above.
$ npm install backbone-moment
$ 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.
Compatibility and Requirements
Backbone-moment supports IE8+ and modern browsers.
This library is © 2015 Paul Falgout. Distributed under MIT license.