forked from penguin86/luna-tracker
Compare commits
15 Commits
bottle_tim
...
8e4a5b89c0
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e4a5b89c0 | |||
| 469666cd0f | |||
| 0e980a8c68 | |||
| b1fc3ce890 | |||
| b88b88623e | |||
| 2709050496 | |||
| 5fe383e488 | |||
| 7d480d6e1c | |||
| bbf3b0ce8e | |||
| 38f2a27c38 | |||
| 6d63ad54f2 | |||
| 553e1c351f | |||
| f8f5d68bb6 | |||
| 280d4558ad | |||
| d74310fad5 |
@@ -455,7 +455,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
fun isValidTime(timeSeconds: Long, durationSeconds: Int): Boolean {
|
fun isValidTime(timeSeconds: Long, durationSeconds: Int): Boolean {
|
||||||
val now = System.currentTimeMillis() / 1000
|
val now = System.currentTimeMillis() / 1000
|
||||||
return (timeSeconds + durationSeconds) <= now && durationSeconds < (24 * 60 * 60)
|
return (timeSeconds + durationSeconds) <= now && durationSeconds < (12 * 60 * 60)
|
||||||
}
|
}
|
||||||
|
|
||||||
val onDateChange = { time: Long ->
|
val onDateChange = { time: Long ->
|
||||||
@@ -499,6 +499,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
||||||
val time = pickedDateTime.time.time / 1000
|
val time = pickedDateTime.time.time / 1000
|
||||||
|
|
||||||
if (isValidTime(time, duration)) {
|
if (isValidTime(time, duration)) {
|
||||||
event.time = time
|
event.time = time
|
||||||
event.quantity = duration
|
event.quantity = duration
|
||||||
|
|||||||
Reference in New Issue
Block a user