') .append($(' ') .append($(' ')) ) ); } function addLegendItem(name, red, green, blue, data){ var nameLabel = jQuery.i18n.prop(name); var isoDateRegEx = /^(\d{4})-\d{2}-\d{2}T.*/; // e.g. 2001-02-31T12:00:00Z with year capture if (name.search(isoDateRegEx) > -1) { // convert full ISO date to YYYY-MM-DD format name = name.replace(isoDateRegEx, "$1"); } $(".legendTable") .append($('