aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-12 04:12:38 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-12 04:12:38 +0200
commit1bc8b4885a95c6f50bae075b83ca9e5850f09a01 (patch)
treee1d0b561fc3ca5c99680f56667f266cd0e65ec0f
parentCreated events dt{start,end} now correct date. (diff)
downloadcalp-1bc8b4885a95c6f50bae075b83ca9e5850f09a01.tar.gz
calp-1bc8b4885a95c6f50bae075b83ca9e5850f09a01.tar.xz
Add deleteIndex to javascript arrays.
-rw-r--r--static/script.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js
index 220451d9..0338cee5 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,3 +1,9 @@
+Array.prototype.deleteIndex = function(idx) {
+ if (idx != -1) {
+ this.splice(idx, 1);
+ }
+}
+
/* -------------------------------------------------- */
function round_time (time, fraction) {