use strftime js library
authorgregor herrmann <gregor@toastfreeware.priv.at>
Mon, 3 Sep 2018 16:02:08 +0000 (18:02 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Mon, 3 Sep 2018 16:02:08 +0000 (18:02 +0200)
that way we get german day/month names, and with a well-known formatting

web/static/seepark_web.js
web/templates/seepark_web.html

index c762fb0d31b000d41f952f80052906eb530cea19..47bd334326207a051bfe7a2e5683ddc6553265ef 100644 (file)
@@ -80,7 +80,10 @@ function dayschart(element, title, days, xtickformat) {
                        x: {
                                type: 'timeseries',
                                tick: {
                        x: {
                                type: 'timeseries',
                                tick: {
-                                       format: xtickformat,
+                                       format: function (d) {
+                                               var strftimeDE = strftime.localizeByIdentifier('de_DE');
+                                               return strftimeDE(xtickformat, new Date(d));
+                                       },
                                        fit: false,
                                        multiline: true, // broken? so →
                                        rotate: -90
                                        fit: false,
                                        multiline: true, // broken? so →
                                        rotate: -90
index 761ded99bde43919823e76c3baae870b4751cf5f..8868950b8badb357e0fa88951cf4576d8cdec202 100644 (file)
                <!-- Load own css -->
                <link href="{{url_for('static', filename='seepark_web.css')}}" rel="stylesheet">
 
                <!-- Load own css -->
                <link href="{{url_for('static', filename='seepark_web.css')}}" rel="stylesheet">
 
-               <!-- Load d3.js and c3.js -->
+               <!-- Load d3.js and c3.js, and strftime.js -->
                <script src="{{url_for('static', filename='d3.min.js')}}" charset="utf-8"></script>
                <script src="{{url_for('static', filename='c3.min.js')}}"></script>
                <script src="{{url_for('static', filename='d3.min.js')}}" charset="utf-8"></script>
                <script src="{{url_for('static', filename='c3.min.js')}}"></script>
+               <script src="{{url_for('static', filename='strftime-min.js')}}"></script>
 
                <title>Seepark Obsteig</title>
        </head>
 
                <title>Seepark Obsteig</title>
        </head>