Skip to content

Instantly share code, notes, and snippets.

View AmyShackles's full-sized avatar
:octocat:

Amy Shackles AmyShackles

:octocat:
View GitHub Profile
@AmyShackles
AmyShackles / getTimezone.js
Created September 15, 2020 14:19
Return time in provided time zone using Intl
function getTimeZone(timeZone) {
if (timeZone) {
let options = {
timeZone,
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric"
@AmyShackles
AmyShackles / timezones.js
Last active October 25, 2020 01:18
Time zone options for Intl
const timeZones = [
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Asmera",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
@AmyShackles
AmyShackles / ReducingYourSort.js
Last active August 26, 2020 00:06
Non-mutative sort through use of reduce
let list = [
'Europe/Andorra',
'Asia/Dubai',
'Asia/Kabul',
'Europe/Tirane',
'Asia/Yerevan',
'Antarctica/Casey',
'Antarctica/Davis',
'Antarctica/DumontDUrville',
'Antarctica/Mawson',