Browse Source

Made TimeAxis robust against old versions of moment.js. Updated to moment.js 2.9.0

v3_develop
jos 10 years ago
parent
commit
3915e9c00c
9 changed files with 13 additions and 8 deletions
  1. +4
    -0
      HISTORY.md
  2. +1
    -1
      examples/graph2d/08_performance.html
  3. +1
    -1
      examples/graph2d/13_localization.html
  4. +1
    -1
      examples/network/34_circular_images.html
  5. +1
    -1
      examples/timeline/03_performance.html
  6. +1
    -1
      examples/timeline/05_groups.html
  7. +1
    -1
      examples/timeline/13_past_and_future.html
  8. +2
    -1
      lib/timeline/TimeStep.js
  9. +1
    -1
      package.json

+ 4
- 0
HISTORY.md View File

@ -4,6 +4,10 @@ http://visjs.org
## not yet released, version 3.7.3-SNAPSHOT ## not yet released, version 3.7.3-SNAPSHOT
### General
- Updated to moment.js v2.9.0
### Network ### Network
- Fixed flipping of hierarchical network on update when using RL and DU. - Fixed flipping of hierarchical network on update when using RL and DU.

+ 1
- 1
examples/graph2d/08_performance.html View File

@ -15,7 +15,7 @@
</style> </style>
<!-- note: moment.js must be loaded before vis.js, else vis.js uses its embedded version of moment.js --> <!-- note: moment.js must be loaded before vis.js, else vis.js uses its embedded version of moment.js -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.3.1/moment.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<script src="../../dist/vis.js"></script> <script src="../../dist/vis.js"></script>
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />

+ 1
- 1
examples/graph2d/13_localization.html View File

@ -13,7 +13,7 @@
} }
</style> </style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment-with-langs.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment-with-langs.min.js"></script>
<script src="../../dist/vis.js"></script> <script src="../../dist/vis.js"></script>
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>

+ 1
- 1
examples/network/34_circular_images.html View File

@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Network | Scalable images</title>
<title>Network | Circular images</title>
<style type="text/css"> <style type="text/css">
body { body {

+ 1
- 1
examples/timeline/03_performance.html View File

@ -11,7 +11,7 @@
</style> </style>
<!-- note: moment.js must be loaded before vis.js, else vis.js uses its embedded version of moment.js --> <!-- note: moment.js must be loaded before vis.js, else vis.js uses its embedded version of moment.js -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.3.1/moment.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<script src="../../dist/vis.js"></script> <script src="../../dist/vis.js"></script>
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />

+ 1
- 1
examples/timeline/05_groups.html View File

@ -17,7 +17,7 @@
</style> </style>
<!-- note: moment.js must be loaded before vis.js, else vis.js uses its embedded version of moment.js --> <!-- note: moment.js must be loaded before vis.js, else vis.js uses its embedded version of moment.js -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.3.1/moment.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<script src="../../dist/vis.js"></script> <script src="../../dist/vis.js"></script>
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />

+ 1
- 1
examples/timeline/13_past_and_future.html View File

@ -80,7 +80,7 @@
// set a custom range from -2 minute to +3 minutes current time // set a custom range from -2 minute to +3 minutes current time
var start = new Date((new Date()).getTime() - 2 * 60 * 1000); var start = new Date((new Date()).getTime() - 2 * 60 * 1000);
var end = new Date((new Date()).getTime() + 3 * 60 * 1000); var end = new Date((new Date()).getTime() + 3 * 60 * 1000);
timeline.setWindow(start, end);
timeline.setWindow(start, end, {animate: false});
</script> </script>

+ 2
- 1
lib/timeline/TimeStep.js View File

@ -527,7 +527,8 @@ TimeStep.prototype.getLabelMajor = function(date) {
}; };
TimeStep.prototype.getClassName = function() { TimeStep.prototype.getClassName = function() {
var date = moment(this.current).locale('en');
var m = moment(this.current);
var date = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function
var step = this.step; var step = this.step;
function even(value) { function even(value) {

+ 1
- 1
package.json View File

@ -30,7 +30,7 @@
"dependencies": { "dependencies": {
"emitter-component": "^1.1.1", "emitter-component": "^1.1.1",
"hammerjs": "^1.1.0", "hammerjs": "^1.1.0",
"moment": "^2.7.0",
"moment": "^2.9.0",
"keycharm": "^0.2.0" "keycharm": "^0.2.0"
}, },
"devDependencies": { "devDependencies": {

Loading…
Cancel
Save