Skip to content

Instantly share code, notes, and snippets.

@danielkellyio
Last active June 26, 2019 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielkellyio/9aff7d479694d3a8174d1c18fa904616 to your computer and use it in GitHub Desktop.
Save danielkellyio/9aff7d479694d3a8174d1c18fa904616 to your computer and use it in GitHub Desktop.
Another bad way to set a variable based on multiple conditions
let friendly_timezone;
switch( tz_timezone ) {
case 'America/New_York':
friendly_timezone = 'Eastern';
break;
case 'America/Chicago':
friendly_timezone = 'Central';
break;
case 'America/Denver':
friendly_timezone = 'Mountain';
break;
case 'America/Los_Angeles':
friendly_timezone = 'Pacific';
break;
default:
friendly_timezone = 'No Timezone Specified';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment