Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

amDateFormat showing formatted dates of day before when using with moment-timezone #293

@Jaspur

Description

@Jaspur

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:
schermafdruk 2017-07-18 21 55 32

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:
schermafdruk 2017-07-18 22 02 52

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions