The calculations are correct for how a computer calculates it:

Birthday A : august 10 - shows today Birthday B : august 11 - shows tomorrow Birthday C : august 12 - shows in 1 day? Show display "in 2 days" Birthday D : august 14 - shows in 3 days? Show display “in 4 days”

Calculations are done starting at the next midnight. So:

Birthday A : august 10 - shows today -- at the next midnight, it's day 0 Birthday B : august 11 - shows tomorrow -- at midnight, it will be day 0 + 1, so 'in 1 day' or 'tomorrow' Birthday C : august 12 - shows in 1 day? Show display "in 2 days" -- at midnight, it will be day 0 + 2, so 'in 2 days' Birthday D : august 14 - shows in 3 days? Show display “in 4 days” -- at midnight, it will be day 0 + 4, so 'in 4 days'

The way the calculations are done isn’t perfect, but it’s how Moment.js returns those values, based on midnight.