Created
April 17, 2018 19:20
-
-
Save thatkookooguy/7f3e8de2f438596009bb63760ffeabce to your computer and use it in GitHub Desktop.
get israeli office holidays from https://publicholidays.co.il/2018-dates/
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
var tbl = jQuery('.publicholidays tr').get().map(function(row) { | |
return jQuery(row).find('td').get().map(function(cell) { | |
return jQuery(cell).text(); | |
}); | |
}).map((holiday) => { | |
const regex = /\d{4}-\d{2}-\d{2}/g; | |
let match = regex.exec(holiday[0] || ""); | |
let date = match ? match[0] : null; | |
let name = (holiday[2] || "").trim(); | |
return {date: date, name: name } | |
}).slice(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment