This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.formatBEVat=(vat)=> { | |
//remove dots | |
let currentVat = vat.replace(/\.+/g,''); | |
//remove letters | |
currentVat = currentVat.replace(/[A-Za-z]/g,''); | |
//remove whitespace | |
currentVat = currentVat.trim(); | |
let finalVat = ""; | |
finalVat = "BE"+currentVat.substring(0,4)+"."+currentVat.substring(4,7)+"."+currentVat.substring(7,10); | |
return finalVat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addDayName (_dateString) { | |
let dateString = _dateString.toString(); | |
let dagen = ["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"]; | |
let arrayOfDate = dateString.split("-"); // symbol in date | |
let swappedDate= arrayOfDate[1] + "/" + arrayOfDate[0] + "/" + arrayOfDate[2]; | |
let date = new Date(Date.parse(swappedDate)); | |
return dagen[date.getDay()]+" "+dateString; | |
} | |
function changeAllOnSelector(selector){ | |
$(document).ready(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Used for class rooms | |
//Only uses this format: 1 or 2 digits first and 1 letter optional | |
//input examples: "2k", "20k", "1", "10" | |
//output examples:"02k","20k", "01", "10" | |
function addZeroToFront(nr) { | |
var val = nr; | |
var numbers = Number(val.replace(/[a-zA-Z]/g, '')); | |
var letter = val.replace(/[0-9]/g, ''); | |
if (val !== "") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.headingtable { | |
top: 80px !important; | |
background-color: #c0c0c0 !important; //dit omdat het black theme de header overschrijft | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.headingtable { | |
top: 79px !important; /*Offset van bovenkant*/ | |
background-color: #c0c0c0 !important; /*Background kleur override, voor black theme*/ | |
} | |
.headingtable tr td{ | |
border: 0; /*Chrome geeft automatisch border, verwijderd borders*/ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.0.js"> | |
</script> | |
</head> | |
<body> | |
<div class="w3-example"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// url: url for the post request | |
// element: which element the loading sign will be on (creates #loading) | |
// updateObject: object with the data to sent. | |
//use a .click() function to trigger this function. | |
function postAjax(url,element,updateObject){ | |
$("#loading").remove(); | |
$(element).append($("<span id='loading'></span>")); | |
let maxtwo = 0; | |
let done = "<i id=\"check\" class=\"fas fa-check\" style=\"margin-left: 15px;\"></i>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//finds duplicate items of self defining properties, returns [{item1,item1duplicate},{item2,item2duplicate},{...}] | |
function (e, data){ | |
const itemList = JSON.parse(data); | |
let data = []; | |
let currentIndexForData = 0; | |
itemList.data.forEach( | |
(item,index)=>{ | |
let addedToDataThisCycle = false; | |
let addedThisItemToDataThisCycle = false; | |
//current item, will check if any other item (exluding self) is same, add to data if so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//es5 | |
function biggestSumOfTwoElements(array){ | |
if (array.length===0){ return false;} | |
else if(array.length===1){ return array[0];} | |
else{ | |
array.sort(function(a, b){return a-b}); | |
return array[array.length-1]+array[array.length-2]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main{ | |
position: absolute; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
} | |
#content{ | |
height: 100%; |
OlderNewer