Skip to content

Instantly share code, notes, and snippets.

@hatone
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save hatone/9187637 to your computer and use it in GitHub Desktop.

Select an option

Save hatone/9187637 to your computer and use it in GitHub Desktop.
あれに何かを書き込むための何か
var str0 = '{"id":0,"name":"GMT","difference":0}';
var str1 = '{"id":1,"name":"JST","difference":9}';
var str2 = '{"id":2,"name":"PST","difference":-8}';
timezones = new Array(JSON.parse(str1), JSON.parse(str2), JSON.parse(str0));
localStorage.setItem("currentTimezone",JSON.stringify(timezones[0]));
localStorage.setItem("myTimezone",JSON.stringify(timezones));
@hatone

hatone commented Feb 24, 2014

Copy link
Copy Markdown
Author

var str0 = '{"id":0,"name":"GMT","difference":0}';
var str1 = '{"id":1,"name":"JST","difference":9}';
var str2 = '{"id":2,"name":"PST","difference":-8}';

timezones = new Array( JSON.parse(str1), JSON.parse(str2), JSON.parse(str0));

localStorage.setItem("currentTimezone",JSON.stringify(timezones[0]));
localStorage.setItem("myTimezone",JSON.stringify(timezones));

@hatone

hatone commented Apr 24, 2014

Copy link
Copy Markdown
Author

var str0 = '{"id":0,"name":"GMT","difference":0}';
var str1 = '{"id":1,"name":"JST","difference":9}';
var str2 = '{"id":2,"name":"PDT","difference":-7}';
var str3 = '{"id":3,"name":"BST","difference":1}';

timezones = new Array( JSON.parse(str2), JSON.parse(str1), JSON.parse(str3), JSON.parse(str0));

localStorage.setItem("currentTimezone",JSON.stringify(timezones[0]));
localStorage.setItem("myTimezone",JSON.stringify(timezones));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment