Skip to content

Instantly share code, notes, and snippets.

@nikhiljha
Created August 16, 2018 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhiljha/e470a1ce38b855fff5fc6ea0ee302224 to your computer and use it in GitHub Desktop.
Save nikhiljha/e470a1ce38b855fff5fc6ea0ee302224 to your computer and use it in GitHub Desktop.
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