Skip to content

Instantly share code, notes, and snippets.

@cdennington
cdennington / gist:5098790
Last active December 14, 2015 14:08
Redmine issue update
//Set an Interval on the function to run every 10 secs
setInterval(function() {
//Get actual date
var date = new Date();
//console.log(date);
var reDate = /(\d+)\/(\d+)\/(\d+)/;
//Make comment date into actual date format
jQuery('a[title]').filter(function(){
var a = jQuery(this);
return a.attr('title').match(reDate);
@cdennington
cdennington / gist:6464117
Last active December 22, 2015 11:09
Stop people not marking issues on progress
jQuery('#issue-form').submit(function() {
var status_dropdown = jQuery("#issue_status_id option:selected").text();
var ratio_dropdown = jQuery("#issue_done_ratio option:selected").text();
if (status_dropdown == "InProgress" && ratio_dropdown == "0 %") {
alert("Are you sure you've not done more work than 0%");
}else if (status_dropdown == "Open") {
alert("Are you sure this shouldn't be marked as in progress");
return false
}else{