0

I'm trying to streamline some of the tasks I do several times a day on Trello, such as adding labels, dates and comments. For some reason, when it comes to updating input fields my values update visually but when submitted they submit the default options.

I can't really fiddle what I've done, but as an example, this is what I've done to set the date. This sets the value as per expectations, visually at least, but when I click the save button it saves it as the default day (tomorrow).

var d = new Date();
    month = d.getMonth() + 1,
    day = d.getDate(),
    year = d.getFullYear();
$('.js-dpicker-date-input').val(month +'/' + day + '/' + year);

enter image description here

Press Save Button

enter image description here

Saves Default (Tomorrow at 12PM)

I think this is because I've not actually typed anything into the input fields, but I don't know the solution.

Any help would be great!

Thanks

5
  • try $('.js-dpicker-date-input').val(month +'/' + day + '/' + year).trigger('change'); Commented May 8, 2017 at 15:06
  • @daremachine no luck :( Commented May 8, 2017 at 15:08
  • their calendar is not jquery based but react based. You need to call prop.change but I don't think its possible outside from component. Commented May 8, 2017 at 15:35
  • @daremachine is there a hacky way of achieving this? It's only going to be an extension anyway so it doesn't have to be the cleanest code. I've tried to trigger a keypress to input a space after my date as that works when entering the date manually to no avail. I can't trigger blur, focus, change or click on the input either. Commented May 8, 2017 at 15:52
  • its not possible, check this stackoverflow.com/questions/37937379/…. I recommend to you use API developers.trello.com/get-started/intro Commented May 8, 2017 at 16:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.