Skip to content

Commit dea75c7

Browse files
authored
Merge pull request python3statement#219 from mscuthbert/sort_timeline
Sort timeline in alphabetical order
2 parents 258327a + b8a98e7 commit dea75c7

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

site.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,19 @@ $(document).ready(function (){
100100
// { content:'<text>', start: <date>, end: <date>, py2:<true|false>},
101101
// ...
102102
// ]
103+
//
104+
// The placement of projects in the data does not matter.
105+
// They will be sorted alphabetically
106+
//
103107
var data = {
104108
'CPython':[
105109
{content:'Python 2.7', start: '2010-07-03', end: '2020-01-01', py2:true},
106110
{content:'Python 3.3', start: '2012-09-29', end: '2017-09-29'},
107-
// EOL for Python 3.4 - 3.7 not announced yet; project 5 years from initial release to follow CPython policy.
108-
{content:'Python 3.4', start: '2014-03-16', end: '2019-03-16'},
111+
{content:'Python 3.4', start: '2014-03-16', end: '2019-03-19'},
112+
// EOL for Python 3.5 - 3.7 not announced yet; project 5 years from initial release to follow CPython policy.
109113
{content:'Python 3.5', start: '2015-09-13', end: '2020-09-13'},
110114
{content:'Python 3.6', start: '2016-12-23', end: '2021-12-23'},
111-
{content:'Python 3.7', start: '2018-06-15', end: '2023-06-01'},
115+
{content:'Python 3.7', start: '2018-06-27', end: '2023-06-27'},
112116
],
113117
'IPython':[
114118
{content: '1.x', start: '2013-08-08', end:'2014-03-31', py2:true},
@@ -236,7 +240,7 @@ $(document).ready(function (){
236240
{content: 'v3', start: '2016-08-22', end: '2017-08-06', py2:true},
237241
{content: 'v4', start: '2017-08-22', end: '2019-06-01', py2:true},
238242
{content: 'v5', start: '2018-03-17', end: '2019-08-01'},
239-
{content: 'v6', start: '2019-08-01', end: '2020-08-01'},
243+
{content: 'v6', start: '2019-06-01', end: '2020-08-01'},
240244
],
241245
'mitmproxy':[
242246
{content: '0.18.x', start: '2016-10-16', end: '2017-10-16', py2:true},
@@ -292,7 +296,7 @@ $(document).ready(function (){
292296
// for tests, rando example
293297
//'matplotlib':[
294298
// {content: 'matplotlib 2.x', start: '2015-06-01', end:'2018-06-01', py2:true},
295-
// {content: 'matplotlib 3.x', start: '2018-6-12', end:'2019-12-01'},
299+
// {content: 'matplotlib 3.x', start: '2018-06-12', end:'2019-12-01'},
296300
//],
297301
//'scikit-bio':[
298302
// {content: '0.18', start: '2016-05-01', end:'2016-11-01', py2:true},
@@ -303,10 +307,16 @@ $(document).ready(function (){
303307
}
304308

305309
// Create a DataSet (allows two way data-binding)
306-
var items = new vis.DataSet([
307-
]);
308-
310+
var items = new vis.DataSet([]);
309311

312+
// put the data in alphabetical order, except CPython at top.
313+
var ordered = {};
314+
Object.keys(data).sort(function (a, b) {
315+
if (a == 'CPython') return -1;
316+
if (b == 'CPython') return 1;
317+
return a.toLowerCase().localeCompare(b.toLowerCase());
318+
}).forEach(function(key) { ordered[key] = data[key] });
319+
data = ordered;
310320

311321
var groups = new vis.DataSet();
312322
var g=0;

0 commit comments

Comments
 (0)