Skip to content

Instantly share code, notes, and snippets.

@valscion
Created November 15, 2016 11:45
Show Gist options
  • Save valscion/cc23af071e6402d32686d462942e3092 to your computer and use it in GitHub Desktop.
Save valscion/cc23af071e6402d32686d462942e3092 to your computer and use it in GitHub Desktop.
Inject date to staff CSV page
// ==UserScript==
// @name Datepicker for Venuu CSV exports
// @include https://staging.venuu.fi/staff/csv_exports*
// @include https://venuu.fi/staff/csv_exports*
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
// @grant none
// ==/UserScript==
//--- Date picker needs additional CSS
document.addEventListener('DOMContentLoaded', function () {
// Add jQuery UI CSS to page
$("head").append(
'<link '
+ 'href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" '
+ 'rel="stylesheet" type="text/css">'
);
//--- Add datepicker popups to select inputs:
$('input[type="date"]').datepicker({
dateFormat: 'yy-mm-dd',
firstDay: 1,
dayNamesMin: ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'],
monthNames: ['Tammikuu', 'Helmikuu', 'Maaliskuu', 'Huhtikuu', 'Toukokuu',
'Kesäkuu', 'Heinäkuu', 'Elokuu', 'Syyskuu', 'Lokakuu',
'Marraskuu', 'Joulukuu']
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment