angular-moment
angular-moment copied to clipboard
amDateFormat showing formatted dates of day before when using with moment-timezone
Code:
<div class="the-date" ng-title="energy.date">
<h5>{{ energy.date | amDateFormat:'dddd' }}</h5>
<h4>{{ energy.date | amDateFormat:'D MMMM YYYY' }}</h4>
</div>
Result:
It's 1990-04-30, but it shows via amDateFormat 29 april 1990. So an incorrect date. Same for the day; it shows "zondag" (Sunday), but it should be Monday.
Timezone is configured correctly:
app.constant('angularMomentConfig', {
timezone: 'Europe/Amsterdam'
});
When I run it via the default moment()
-function like this:
console.info(energy.date);
console.info(moment(energy.date));
It's showing it correctly:
It happens by multiple dates in the past, so is it a bug in the amDateFormat
somewhere?
When I remove moment-timezone
as a dependency it shows it all correctly.. Why is this?