Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:22:52+00:00 2026-06-14T21:22:52+00:00

I am using quite complex property bindings to be able to change either day,

  • 0

I am using quite complex property bindings to be able to change either day, month or year of a user’s birthdate. Having an attr birthDate of type date on a user and three properties for each piece of the date.
I am using moment.js to simplify date manipulations.

By trying the reduced showcase on jsfiddle you’ll see that if you change year or day, the month is always increased by 1. I can’t say what is happening. Just this: when setting the new date, the value is correct and gets changed later. Is there an issue with ember-data date attributes and some formating?

Again: here’s the jsfiddle – written in CoffeeScript.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:22:53+00:00Added an answer on June 14, 2026 at 9:22 pm

    I looked at your code and it looked like it should be working fine, the more I stepped through it the more I got annoyed that I couldn’t spot the problem … turns out it’s the .month() method from Moment.js … from the docs:

    “Mutates the original moment by changing the month. Accepts numbers from 0 to 11”

    Pretty dumb huh? In any case change your setMonth to subtract 1 from the value when you use .month()

    setMonth: (property, value) ->
      @set property, moment(@get(property)).month(value-1).format()
      return value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a quite complex js charting library using d3.js. The code is
I'm using Bison and I've generated a quite complex grammar. The trouble is that
I'm using view flipper to make the user to be able to slide between
I have a quite complex (C++) project using autoconf / automake, which includes some
I'm trying to create a quite complex query with Doctrine's Query Builder (I'm using
I'm writing single-page web application. Client interacts with server using AJAX retrieving quite complex
This could either be very simple or quite complex I'm not sure at this
I've been using openCV quite a bit lately and I'm amazed at how fast
I´m using Mysql since quite a while and am really confused by the result
I am quite confused using the Facebook application in the iframe. I granted permissions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.