Skip to content

Instantly share code, notes, and snippets.

@nekova
nekova / highlight.dart
Last active August 29, 2015 14:02
Implement `github_actrnuf` with Dart
import 'dart:html';
void classifyDate(Element modified_at) {
RegExp more_a_year = new RegExp("year");
RegExp more_5_month = new RegExp("([5-9]|1)+ months");
if (more_a_year.hasMatch(modified_at.text)) {
modified_at.style.color = 'red';
}else if (more_5_month.hasMatch(modified_at.text)) {
modified_at.style.color = 'orange';
}