mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
sort: Converted from ISO8601p to Duration
This commit is contained in:
parent
b344f95e97
commit
43d49d17d0
1 changed files with 5 additions and 5 deletions
10
src/sort.cpp
10
src/sort.cpp
|
@ -30,7 +30,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
#include <ISO8601.h>
|
#include <Duration.h>
|
||||||
#include <Task.h>
|
#include <Task.h>
|
||||||
#include <shared.h>
|
#include <shared.h>
|
||||||
#include <format.h>
|
#include <format.h>
|
||||||
|
@ -190,8 +190,8 @@ static bool sort_compare (int left, int right)
|
||||||
if (left_string == right_string)
|
if (left_string == right_string)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ISO8601p left_duration (left_string);
|
Duration left_duration (left_string);
|
||||||
ISO8601p right_duration (right_string);
|
Duration right_duration (right_string);
|
||||||
return ascending ? (left_duration < right_duration)
|
return ascending ? (left_duration < right_duration)
|
||||||
: (left_duration > right_duration);
|
: (left_duration > right_duration);
|
||||||
}
|
}
|
||||||
|
@ -266,8 +266,8 @@ static bool sort_compare (int left, int right)
|
||||||
if (left_string == right_string)
|
if (left_string == right_string)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ISO8601p left_duration (left_string);
|
Duration left_duration (left_string);
|
||||||
ISO8601p right_duration (right_string);
|
Duration right_duration (right_string);
|
||||||
return ascending ? (left_duration < right_duration)
|
return ascending ? (left_duration < right_duration)
|
||||||
: (left_duration > right_duration);
|
: (left_duration > right_duration);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue