Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Sort by due date #13

Open
mattfysh opened this issue Nov 27, 2016 · 8 comments
Open

Sort by due date #13

mattfysh opened this issue Nov 27, 2016 · 8 comments

Comments

@mattfysh
Copy link

Great workflow, love that I can add a new todo in <1 sec now! Quick question on the todos list... is there something I can type or configure to see only overdue + today's tasks? Right now when I type todos I'll see a list of (somewhat) arbitrarily-sorted items. Thanks! 😃

@mattfysh
Copy link
Author

nice-to-have: also sort by priority

@moranje
Copy link
Owner

moranje commented May 27, 2017

Hi! Is this still something that would interest you?

@stphnlwlsh
Copy link
Contributor

I second this and might be able to take a crack at it.

@moranje
Copy link
Owner

moranje commented Jun 15, 2017

I am working on this myself, but in doing so I refactored a lot of the js code. Now is a bad time to jump into this.

@moranje
Copy link
Owner

moranje commented Jun 25, 2017

I am postponing this feature until next release. Time contrains and all. Thanks for understanding.

Martien

@carlosflorencio
Copy link

carlosflorencio commented Jan 14, 2018

Any news on this? :)

Just added a quick dirty fix to calls.js file by replacing the getTasksCapped function with this one:

/**
 * Get a capped list of tasks from Todoist.
 *
 * @author moranje <martieno@gmail.com>
 * @since  2016-07-03
 * @return {Object}
 */
function getTasksCapped() {
  var list = [];

  todoist.getTasks( settings.token, function( data ) {
    if ( !Array.isArray( data.items ) ) return error( data );

    data.items.sort(function(a, b){
      return new Date(a.due_date_utc) - new Date(b.due_date_utc);
    })

    data.items.map(function(item) {
      let date = new Date(item.due_date_utc)
      let miliseconds24hours = 1000 * 1 * 60 * 60 * 24

      if(date - Date.now() <= miliseconds24hours) {
        item.content += " (Today)"
      }

      return item
    })

    data.items.forEach( function( task, index ) {
      if ( index < settings.max_items ) {
        list.push( task );
      }
    } );

    return echo( optionList( list ) );
  } );
}

Sorting by due date and appeding (today) for the tasks that due in that day.

@moranje
Copy link
Owner

moranje commented Jan 14, 2018

Yeah I have much of the rewritten code finished but I haven't had any time to squash the last bugs and update the test suite between a home make-over, work and my parental duties. I don't have a lot of time to allocate in January. Thanks for helping out.

M

@moranje moranje added this to the v5.8.0 milestone Mar 28, 2019
moranje added a commit that referenced this issue Feb 16, 2020
moranje pushed a commit that referenced this issue Feb 16, 2020
# [6.0.0-alpha.8](v6.0.0-alpha.7...v6.0.0-alpha.8) (2020-02-16)

### Bug Fixes

* **cache:** cache always being reset ([d83408e](d83408e))

### Features

* **commands:** [#13](#13) sort by due date by default ([32044b0](32044b0))
@moranje
Copy link
Owner

moranje commented Feb 16, 2020

🎉 This issue has been resolved in version 6.0.0-alpha.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

moranje pushed a commit that referenced this issue Feb 22, 2020
# [6.0.0-alpha.9](v6.0.0-alpha.8...v6.0.0-alpha.9) (2020-02-22)

### Bug Fixes

* **commands:** certain characters not (" and \) being parsed ([d53d68f](d53d68f))

### Features

* **commands:** filter tasks directly through Todoist ([f9bd460](f9bd460)), closes [#13](#13) [#20](#20) [#72](#72)
github-actions bot pushed a commit that referenced this issue Feb 26, 2020
# [6.0.0-beta.1](v5.8.4...v6.0.0-beta.1) (2020-02-26)

### Bug Fixes

* **settings:** rename annonymous_statistics to error_tracking ([3816345](3816345))
* api filter requests being broken ([3b344a1](3b344a1))
* **build:** possibly fix version number not updated in alfred workflow ([ac02c22](ac02c22))
* **cache:** cache always being reset ([d83408e](d83408e))
* **cache:** handle empty resource lists ([af89785](af89785))
* **cache:** issue where cache timestamps wouldn't be updated once created ([5156040](5156040))
* **commands:** [#151](#151) don't rely on alfred input filtering, remove uids ([92d9ac4](92d9ac4))
* **commands:** certain characters not (" and \) being parsed ([d53d68f](d53d68f))
* **commands:** error when trying to retrieve a non existent project ([42e0009](42e0009))
* **project:** unhelpful error message when missing todoist token in settings ([5a0af91](5a0af91))
* **settings:** [#152](#152) settings break with multiple consecutive spaces ([b3f2f2a](b3f2f2a))
* **todoist:** task cache not being refreshed ([179c0bc](179c0bc))
* alfred workflow version is the same as the release version again ([0ce67a3](0ce67a3))
* updater not picking up new prereleases, please update manually ([fdcb793](fdcb793))
* updater not storing last update timestamp ([35ff532](35ff532))

### Features

* **commands:** [#13](#13) sort by due date by default ([32044b0](32044b0))
* **commands:** filter tasks directly through Todoist ([f9bd460](f9bd460)), closes [#13](#13) [#20](#20) [#72](#72)
* **parser:** reimplement date from now for timestamped tasks ([cd090d8](cd090d8))
* **project:** full rewrite ([2849c8a](2849c8a)), closes [#128](#128) [#126](#126) [#20](#20) [#124](#124) [#128](#128) [#126](#126) [#124](#124) [#20](#20)
* **project:** provide a useful error as a list item when node.js is not installed ([e039157](e039157))

### BREAKING CHANGES

* **project:** Improve string parsing, now requires id for project, labels and sections
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants