Created
August 16, 2018 20:52
-
-
Save nikhiljha/e470a1ce38b855fff5fc6ea0ee302224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
void main() { | |
List decoded = json.decode("""[ | |
{ | |
"date": "2018-08-23 08:00:00", | |
"end": "2018-08-23 08:25:00", | |
"info": "Advisement", | |
"isclass": "1", | |
"period": "-4" | |
}, | |
{ | |
"date": "2018-08-23 08:31:00", | |
"end": "2018-08-23 09:12:00", | |
"info": "nan", | |
"isclass": "1", | |
"period": "1" | |
}, | |
{ | |
"date": "2018-08-23 09:18:00", | |
"end": "2018-08-23 09:59:00", | |
"info": "nan", | |
"isclass": "1", | |
"period": "2" | |
}]"""); | |
var now = new DateTime.now(); | |
print(decoded.where((i) => DateTime.parse(i['end']).isAfter(now)).toList()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment