Skip to content

Instantly share code, notes, and snippets.

@benedmunds benedmunds/Result
Last active Aug 29, 2015

Embed
What would you like to do?
<li class="gig ng-scope">
<div class="month september-2014">
<h2>April</h2>
<h3>2014</h3>
</div>
<div class="info-container">
<div class="info">
<div class="calendar">
<div class="monthtop ng-binding">Apr
<img ng-src="/dist/img/flags/GB.png" src="/dist/img/flags/GB.png">
</div>
<div class="day ng-binding">19</div>
</div>
<div class="text" ng-switch="" on="gig.status">
<h1 class="ng-binding">Fabric <!-- ngSwitchWhen: cancelled --></h1>
<h2 class="ng-binding"></h2>
<h3 class="loc">
<span ng-show="gig.city" class="ng-binding">London</span>
<span ng-show="gig.country.name" class="ng-binding">, United Kingdom</span>
</h3>
</div>
</div>
<div class="actions">
<span class="created">Created 13/03/13 at 3:30pm</span>
<ul class="buttons">
<li><a class="delete" href="">Delete</a></li>
<li><a href="">Duplicate</a></li>
<li><a href="">Edit</a></li>
</ul>
</div>
</div>
</li>
<li class="gig ng-scope">
<div class="month october-2014">
<h2>April</h2>
<h3>2014</h3>
</div>
<div class="info-container">
<div class="info">
<div class="calendar">
<div class="monthtop ng-binding">Apr
<img ng-src="/dist/img/flags/GB.png" src="/dist/img/flags/GB.png">
</div>
<div class="day ng-binding">19</div>
</div>
<div class="text" ng-switch="" on="gig.status">
<h1 class="ng-binding">Fabric <!-- ngSwitchWhen: cancelled --></h1>
<h2 class="ng-binding"></h2>
<h3 class="loc">
<span ng-show="gig.city" class="ng-binding">London</span>
<span ng-show="gig.country.name" class="ng-binding">, United Kingdom</span>
</h3>
</div>
</div>
<div class="actions">
<span class="created">Created 13/03/13 at 3:30pm</span>
<ul class="buttons">
<li><a class="delete" href="">Delete</a></li>
<li><a href="">Duplicate</a></li>
<li><a href="">Edit</a></li>
</ul>
</div>
</div>
</li>
<script>
$(document).ready(function(){
$('.month').each(function(){
//grab the classes
var classes = $(this).attr('class').split(/\s+/);
for (c in classes) {
//only check against the date classes
if (/\w*-\d{4}/.test(classes[c])) {
//hide the other elements matching this date class
$('.'+classes[c]).first().show();
}
}
});
});
</script>
@rafidcse

This comment has been minimized.

Copy link

commented Apr 16, 2014

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.