Skip to content

Instantly share code, notes, and snippets.

@benedmunds
Last active August 29, 2015 13:59
Show Gist options
  • Save benedmunds/10498571 to your computer and use it in GitHub Desktop.
Save benedmunds/10498571 to your computer and use it in GitHub Desktop.
<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
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment