Skip to content

Instantly share code, notes, and snippets.

@birdyboy18
Created March 28, 2017 21:42
Show Gist options
  • Save birdyboy18/def75614b74e93c209c8a52718262f5f to your computer and use it in GitHub Desktop.
Save birdyboy18/def75614b74e93c209c8a52718262f5f to your computer and use it in GitHub Desktop.
Maise changes
.controller('GigController', function($scope){
var gigs = $('.js-gig-date');
var now = new Date();
console.log(now);
gigs.each(function(i, el) {
var $el = $(el);
var date = $el.attr('data-date');
var gigtime = new Date(date);
console.log(gigtime);
if (now > gigtime) {
$el.addClass('passed');
}
});
})
<tbody>
<tr class="js-gig-date" data-date="2017, March, 26">
<td scope="row">26th March</td>
<td>Junk</td>
<td><a class="link-effect" href="https://www.google.co.uk/maps/place/Junk/@50.9121357,-1.4061366,17z/data=!3m1!4b1!4m5!3m4!1s0x487476ae71990627:0x1c70fe6a7a1e05f3!8m2!3d50.9121357!4d-1.4039479"><span class="glyphicon glyphicon-map-marker"></span></a> Southampton</td>
<td>£10.00</td>
</tr>
<tr class="js-gig-date" data-date="2017, March, 28">
<td scope="row">28th March</td>
<td>Motion</td>
<td><a class="link-effect" href="https://www.google.co.uk/maps/place/Motion/@51.44949,-2.5781197,17z/data=!3m1!4b1!4m5!3m4!1s0x48718e6150a4747b:0xc0bbddb6c7a37b1b!8m2!3d51.44949!4d-2.575931?q=motion+bristol&rlz=1C5CHFA_enGB708GB708&ion=1&espv=2&bav=on.2,or.r_cp.&bvm=bv.149760088,d.ZGg&biw=1254&bih=680&dpr=1&um=1&ie=UTF-8&sa=X&ved=0ahUKEwjnzvqulOXSAhUMIMAKHUDKCigQ_AUIBigB"><span class="glyphicon glyphicon-map-marker"></span></a> Bristol</td>
<td>£10.00</td>
</tr>
<tr class="js-gig-date" data-date="2017, March, 30">
<td scope="row">30th March</td>
<td>XOYO</td>
<td><a class="link-effect" href="https://www.google.co.uk/maps/place/XOYO/@51.525393,-0.0878168,17z/data=!3m1!4b1!4m5!3m4!1s0x48761caf7d9f0e89:0x4f8a5685ed3194d5!8m2!3d51.525393!4d-0.0856281"><span class="glyphicon glyphicon-map-marker"></span></a> London</td>
<td>£10.00</td>
</tr>
<tr class="js-gig-date" data-date="2017, April, 1">
<td scope="row">1st April</td>
<td>The Nest</td>
<td><a class="link-effect" href="https://www.google.co.uk/maps/place/The+Nest/@51.5517482,-0.0768948,17z/data=!3m1!4b1!4m5!3m4!1s0x48761c8c74f0483b:0x40140abcb993626a!8m2!3d51.5517482!4d-0.0747061"><span class="glyphicon glyphicon-map-marker"></span></a> London</td>
<td>£10.00</td>
</tr>
<tr class="js-gig-date" data-date="2017, April, 3">
<td scope="row">3rd April</td>
<td>Cameo</td>
<td><a class="link-effect" href="https://www.google.co.uk/maps/place/Cameo/@50.7219793,-1.8759617,17z/data=!3m1!4b1!4m5!3m4!1s0x4873a1c367b1d143:0x4613b588dc282709!8m2!3d50.7219793!4d-1.873773"><span class="glyphicon glyphicon-map-marker"></span></a> Bournemouth</td>
<td>£10.00</td>
</tr>
</tbody>
tr.passed td {
text-decoration: line-through;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment