I include moments.js in the following way
<script src="../static/js/moment-timezone-full.js"></script>
<script>
$('.select_timezone').timezones();
</script>
I then give the timezone selection to my user in the html as
<div class="row">
<div class="col-lg-4">
<select class="select_timezone" name="select_timezone"></select>
</div>
</div>
My question is how can I select a default timezone? I saw that one can do that with
moment.tz.setDefault(String);
but I don't understand how this would work in my setup?
EDIT: My implementation is just following this example...
http://www.jqueryscript.net/time-clock/Easy-Timezone-Picker-with-jQuery-Moment-js-Timezones.html
does really nobody know a solution to this? carl
EDIT: I should clarify why moment.tz.setDefault does not work. When I add the line
moment.tz.setDefault('America/Los_Angeles');
I get the javascript error
Uncaught TypeError: Cannot read property 'setDefault' of undefined
I include moments as explained in the flask mega-tutorial meaning I do
from flask.ext.moment import Moment
...
moment = Moment()
...
moment.init_app(app)
and in my html template I do
{% block scripts %}
{{ moment.include_moment() }}
{% endblock %}
moment-timezones is included with the js file as shown above. Have I forgotten anything? I am just trying to set the default timezone for the selection