Skip to content

Change daily tasks get_due to use server's isDue property #5

@goldfndr

Description

@goldfndr

Currently, the get_due function expects all daily tasks to be have frequency=weekly. That is, the days of the week (within repeat) are true/false depending on whether the task is due that particular weekday.

But, since 6/11/2015, Habitica has changed to also accept frequency=daily with an everyX value corresponding to an interval and a startDate (in ISO 8601 format) for when the every X started. Obviously, this requires new code to handle it, and converting ISO 8601 to something more usable (like seconds since epoch) is nontrivial.

The User Data Display Tool handles this by including:
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
and using Moment.js to check the date for due-ness.

It would be preferable to handle this by on-demand loading if possible, as only the get_due function would use this functionality and it would be slightly cumbersome to require moment.js (or moment.min.js) be specified in the JavaScript action as a Library (and that's assuming that loading it as a library would even work).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions