Created
November 15, 2016 11:45
-
-
Save valscion/cc23af071e6402d32686d462942e3092 to your computer and use it in GitHub Desktop.
Inject date to staff CSV page
This file contains 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
// ==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