Skip to content

Instantly share code, notes, and snippets.

View dtomasi's full-sized avatar

Dominik Tomasi dtomasi

  • Waldshut-Tiengen, Germany
  • 15:35 (UTC +02:00)
View GitHub Profile
@dtomasi
dtomasi / camel-kebab.js
Created April 18, 2017 09:45
CamelCase to kebab-case and backwards
/**
* Convert Strings from camelCase to kebab-case
* @returns {string}
* @param input
*/
static camelToKebab(input: string) {
return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
/**
@dtomasi
dtomasi / dateHelpers.js
Last active August 31, 2018 19:50
Set of Date-Helper-Functions
/**
* Get the last full our of given date or now
*/
function getPrevFullHour(date) {
if (!date) {
date = new Date();
}
var copiedDate = new Date(date);
copiedDate.setMinutes(0);