Skip to content
  • 0 Votes
    10 Posts
    2k Views
    L

    @mrjj
    I have moved forward from calling my saved dates to receive the following:

    Read Value: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object] for key: dates

    (one for each date saved)
    when adding

    if(success) { console.log(JSON.stringify(value)) }

    I can also read the saved dates in the format of:

    [{"date":"2018-10-01T21:17:00.926"},{"date":"2018-10-02T12:00:00.000"},{"date":"2018-10-03T12:00:00.000"},{"date":"2018-10-06T12:00:00.000"},{"date":"2018-10-07T12:00:00.000"},{"date":"2018-10-08T12:00:00.000"}]

    now how would I determine these dates are saved in my calendar to add the marker?

    I have tried adding a property bool to the marker so the read value equals isMarked = true yet this either marks every date on the calendar or none at all depending on how I am working this?!?

    How would I convert the JSON string to individual date reads?

  • 0 Votes
    4 Posts
    6k Views
    cxamC

    @the_ @SGaist Hi, I managed to solve it on my own by encoding the date to a JulianDate and using juliandate on my db so it's much easier to compare and so.

    Thanks for your help.

  • Change language of date

    Unsolved QML and Qt Quick
    1
    0 Votes
    1 Posts
    832 Views
    No one has replied
  • setHours() do not work

    Solved QML and Qt Quick
    3
    0 Votes
    3 Posts
    2k Views
    A

    Luckily I found solution myself :)
    According to http://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html#javascript-environment-restrictions "global" object cannot be modified inside a JavaScript function.
    In this cause that code was part of onClicked property.
    Proper code:

    onClicked : { var working_time = calendarForDate.chosen_Hour; // local variable working_time.setHours( (calendarForDate.chosen_Hour.getHours() + 1)%24 ); // now JavaScript can modify that calendarForDate.chosen_Hour = working_time; console.log(calendarForDate.chosen_Hour.getHours()); // one cannot modify global object, but that's perfectly fine hoursField.text = calendarForDate.chosen_Hour.getHours() // now it works as intended }

    Thanks for you attention.