Compare commits
3 Commits
32cb827d26
...
v2.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| bfb1bb3433 | |||
| 676ef83e50 | |||
| adbc2cf364 |
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
|||||||
module git.donadeo.net/pdonadeo/todotxt2remind
|
module git.donadeo.net/pdonadeo/todotxt2remind/v2
|
||||||
|
|
||||||
go 1.24.1
|
go 1.24.1
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -104,12 +105,10 @@ func (t Task) PriorityAsRemind() int {
|
|||||||
if p < 'A' || p > 'Z' {
|
if p < 'A' || p > 'Z' {
|
||||||
return 5000
|
return 5000
|
||||||
}
|
}
|
||||||
step := 9999 / 25 // 399
|
pInt := int(p) - 65 // 'A' = 65
|
||||||
val := 9999 - int(p-'A')*step
|
value := 9999 - (float64(pInt) * (float64(9999) / float64(25)))
|
||||||
if p == 'Z' {
|
value = math.Round(value)
|
||||||
return 0
|
return int(value)
|
||||||
}
|
|
||||||
return val
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t Task) MarshalJSON() ([]byte, error) {
|
func (t Task) MarshalJSON() ([]byte, error) {
|
||||||
|
|||||||
4
main.go
4
main.go
@@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"git.donadeo.net/pdonadeo/todotxt2remind/internal/parser"
|
"git.donadeo.net/pdonadeo/todotxt2remind/v2/internal/parser"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ var (
|
|||||||
inputFile string
|
inputFile string
|
||||||
outputFile string
|
outputFile string
|
||||||
debug bool
|
debug bool
|
||||||
version = "1"
|
version = "v2.0.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user