todo-jsonl 0.1.19 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/todo.rb +5 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fd0447c1a7546c396ad8c792f7b7da0d2a72dcf9bf0d20aefd554cffb4c40cb
4
- data.tar.gz: 49428f5380ed3c56b4c548e80661c77a1a83e6129a69dae7292457f423532390
3
+ metadata.gz: d39cdc12b9d904368b86e79438a242689700825c668b0ca69aedba68025c9c9f
4
+ data.tar.gz: f219916b78035ba1daab7211c4318dc7063123a10f9fdcbc6aae91e62265b2b0
5
5
  SHA512:
6
- metadata.gz: 0cdc1df93f9b9c194fbe48486dc0b6d92b8f2613af3d2b9d398ac2bd2b0478025ce8a495e98c1860888cbe7335d33997ce23ef5e7b9d1c2be53bbaf400a6e967
7
- data.tar.gz: 8d04c7605fdc2e96ec5b8adcd88b115e805a5441cc32ec50b3c7839beb350e1fb215f07874f34a14301ffd8b36cfe6f1f735731e65e17b8d98235a56e6c61052
6
+ metadata.gz: 4bb6565bd2a1d4890f3c06fa9b88b7a711d48f1f02fad0b8fcac306c8348a1b65635b9e48245d12abfee95c1eb465ab1790593e3b746c0dc5508d7e97524df23
7
+ data.tar.gz: d1d9bdcebc0c579ca4e15e1aeb6723885766c5b8790accf284d7619f507e3f4d613ef2cca98c8b7d6e25e43e4bdb55523a28a5616ba1ed95ca1a763ed50bb459
data/bin/todo.rb CHANGED
@@ -165,8 +165,8 @@ class Todo
165
165
  end
166
166
 
167
167
  def setup
168
- @today = Time.now
169
- next_7_days = (0..6).map do |day| (@today.to_date + day) end
168
+ @today = Date.today
169
+ next_7_days = (0..6).map do |day| @today + day end
170
170
  @due_date_days = next_7_days.map do |day| day.strftime('%A').downcase end
171
171
  due_dates_for_queries = next_7_days.map do |day| day.strftime(DATE_FORMAT) end
172
172
 
@@ -316,7 +316,7 @@ class Todo
316
316
  priority_flag = task[:priority] ? colorize(PRIORITY_FLAG, :red) : ' '
317
317
  due_date = ''
318
318
  if task[:due] && state != 'done'
319
- date_diff = (Date.parse(task[:due]) - @today.to_date).to_i
319
+ date_diff = (Date.strptime(task[:due], DATE_FORMAT) - @today).to_i
320
320
  if date_diff < 0
321
321
  due_date = colorize("(#{date_diff.abs}d overdue)", :red)
322
322
  elsif date_diff == 0 || date_diff == 1
@@ -379,9 +379,9 @@ class Todo
379
379
  DUE_DATE_DAYS_SIMPLE.index(date.to_s.downcase) ||
380
380
  @due_date_days.map do |day| day[0..2] end.index(date.to_s.downcase)
381
381
  if day_index
382
- due = (@today.to_date + day_index).strftime(DATE_FORMAT)
382
+ due = (@today + day_index).strftime(DATE_FORMAT)
383
383
  else
384
- due = date.nil? || date.empty? ? nil : Date.parse(date).strftime(DATE_FORMAT)
384
+ due = date.nil? || date.empty? ? nil : Date.strptime(date, DATE_FORMAT).strftime(DATE_FORMAT)
385
385
  end
386
386
  return due
387
387
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todo-jsonl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabor Bata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: