comparison src/main/kotlin/name/blackcap/passman/ListSubcommand.kt @ 29:bf78f7f9dad3 default tip

Fix timestamp-matching bug.
author David Barts <n5jrn@me.com>
date Mon, 30 Dec 2024 17:10:11 -0800
parents 69526ae8c8de
children
comparison
equal deleted inserted replaced
28:287eadf5ab30 29:bf78f7f9dad3
109 } 109 }
110 if (it.name !in matchers) { 110 if (it.name !in matchers) {
111 matchers[it.name] = mutableListOf<(Any?) -> Boolean>() 111 matchers[it.name] = mutableListOf<(Any?) -> Boolean>()
112 } 112 }
113 when(op) { 113 when(op) {
114 '>' -> matchers[it.name]!! += { x -> x is Long && x > value } 114 '>' -> matchers[it.name]!! += { x -> x is java.util.Date && x.time > value }
115 '=' -> matchers[it.name]!! += { x -> x is Long && (x/1000L) == (value/1000L) } 115 '=' -> matchers[it.name]!! += { x -> x is java.util.Date && (x.time/1000L) == (value/1000L) }
116 '<' -> matchers[it.name]!! += { x -> x is Long && x < value } 116 '<' -> matchers[it.name]!! += { x -> x is java.util.Date && x.time < value }
117 else -> throw RuntimeException("should never happen") 117 else -> throw RuntimeException("should never happen")
118 } 118 }
119 } 119 }
120 } 120 }
121 } 121 }