Skip to content

Instantly share code, notes, and snippets.

@mgratch
Created February 8, 2018 18:24
Show Gist options
  • Save mgratch/1fbcad2a2b52e4f5dcc1d45cbaa44f7b to your computer and use it in GitHub Desktop.
Save mgratch/1fbcad2a2b52e4f5dcc1d45cbaa44f7b to your computer and use it in GitHub Desktop.
Find the ID of the item you want to keep, select all above that. Useful if a project has hours spanning months and you only need this months hours.
/**
* Delete all items above a specific ID ... i.e. I import a project time from toggl
* which spans multiple months. I only want this months. So I find the first item I need to keep.
* All the items above should be deleted.
**/
jQuery.each(jQuery('#2623').prevAll(), function(){
jQuery(this).find(jQuery('.time_entry_deletion')).click();
})
/**
* Delete all items from a project
**/
jQuery.each(jQuery('.time_entry_deletion'), function(){
jQuery(this).click();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment