mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Added timer disable general
This commit is contained in:
parent
fd981053cf
commit
38172a2c1c
8 changed files with 317 additions and 52 deletions
11
lib/functions/time_server_disabled.dart
Normal file
11
lib/functions/time_server_disabled.dart
Normal file
|
@ -0,0 +1,11 @@
|
|||
DateTime generateTimeDeadline(int time) {
|
||||
DateTime date = DateTime.now();
|
||||
date = date.add(Duration(milliseconds: time));
|
||||
return date;
|
||||
}
|
||||
|
||||
String generateRemainingTimeString(Duration difference) {
|
||||
final int seconds = difference.inSeconds+1;
|
||||
final DateTime time = DateTime(0, 0, 0, 0, 0, seconds > 0 ? seconds : 0);
|
||||
return "${time.hour > 0 ? "${time.hour}:" : ''}${time.minute.toString().padLeft(2, '0')}:${time.second.toString().padLeft(2, '0')}";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue