{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", | |
"DC": "District Of Columbia", | |
"FM": "Federated States Of Micronesia", | |
"FL": "Florida", | |
"GA": "Georgia", | |
"GU": "Guam", | |
"HI": "Hawaii", | |
"ID": "Idaho", | |
"IL": "Illinois", | |
"IN": "Indiana", | |
"IA": "Iowa", | |
"KS": "Kansas", | |
"KY": "Kentucky", | |
"LA": "Louisiana", | |
"ME": "Maine", | |
"MH": "Marshall Islands", | |
"MD": "Maryland", | |
"MA": "Massachusetts", | |
"MI": "Michigan", | |
"MN": "Minnesota", | |
"MS": "Mississippi", | |
"MO": "Missouri", | |
"MT": "Montana", | |
"NE": "Nebraska", | |
"NV": "Nevada", | |
"NH": "New Hampshire", | |
"NJ": "New Jersey", | |
"NM": "New Mexico", | |
"NY": "New York", | |
"NC": "North Carolina", | |
"ND": "North Dakota", | |
"MP": "Northern Mariana Islands", | |
"OH": "Ohio", | |
"OK": "Oklahoma", | |
"OR": "Oregon", | |
"PW": "Palau", | |
"PA": "Pennsylvania", | |
"PR": "Puerto Rico", | |
"RI": "Rhode Island", | |
"SC": "South Carolina", | |
"SD": "South Dakota", | |
"TN": "Tennessee", | |
"TX": "Texas", | |
"UT": "Utah", | |
"VT": "Vermont", | |
"VI": "Virgin Islands", | |
"VA": "Virginia", | |
"WA": "Washington", | |
"WV": "West Virginia", | |
"WI": "Wisconsin", | |
"WY": "Wyoming" | |
} |
[ | |
{ | |
"name": "Alabama", | |
"abbreviation": "AL" | |
}, | |
{ | |
"name": "Alaska", | |
"abbreviation": "AK" | |
}, | |
{ | |
"name": "American Samoa", | |
"abbreviation": "AS" | |
}, | |
{ | |
"name": "Arizona", | |
"abbreviation": "AZ" | |
}, | |
{ | |
"name": "Arkansas", | |
"abbreviation": "AR" | |
}, | |
{ | |
"name": "California", | |
"abbreviation": "CA" | |
}, | |
{ | |
"name": "Colorado", | |
"abbreviation": "CO" | |
}, | |
{ | |
"name": "Connecticut", | |
"abbreviation": "CT" | |
}, | |
{ | |
"name": "Delaware", | |
"abbreviation": "DE" | |
}, | |
{ | |
"name": "District Of Columbia", | |
"abbreviation": "DC" | |
}, | |
{ | |
"name": "Federated States Of Micronesia", | |
"abbreviation": "FM" | |
}, | |
{ | |
"name": "Florida", | |
"abbreviation": "FL" | |
}, | |
{ | |
"name": "Georgia", | |
"abbreviation": "GA" | |
}, | |
{ | |
"name": "Guam", | |
"abbreviation": "GU" | |
}, | |
{ | |
"name": "Hawaii", | |
"abbreviation": "HI" | |
}, | |
{ | |
"name": "Idaho", | |
"abbreviation": "ID" | |
}, | |
{ | |
"name": "Illinois", | |
"abbreviation": "IL" | |
}, | |
{ | |
"name": "Indiana", | |
"abbreviation": "IN" | |
}, | |
{ | |
"name": "Iowa", | |
"abbreviation": "IA" | |
}, | |
{ | |
"name": "Kansas", | |
"abbreviation": "KS" | |
}, | |
{ | |
"name": "Kentucky", | |
"abbreviation": "KY" | |
}, | |
{ | |
"name": "Louisiana", | |
"abbreviation": "LA" | |
}, | |
{ | |
"name": "Maine", | |
"abbreviation": "ME" | |
}, | |
{ | |
"name": "Marshall Islands", | |
"abbreviation": "MH" | |
}, | |
{ | |
"name": "Maryland", | |
"abbreviation": "MD" | |
}, | |
{ | |
"name": "Massachusetts", | |
"abbreviation": "MA" | |
}, | |
{ | |
"name": "Michigan", | |
"abbreviation": "MI" | |
}, | |
{ | |
"name": "Minnesota", | |
"abbreviation": "MN" | |
}, | |
{ | |
"name": "Mississippi", | |
"abbreviation": "MS" | |
}, | |
{ | |
"name": "Missouri", | |
"abbreviation": "MO" | |
}, | |
{ | |
"name": "Montana", | |
"abbreviation": "MT" | |
}, | |
{ | |
"name": "Nebraska", | |
"abbreviation": "NE" | |
}, | |
{ | |
"name": "Nevada", | |
"abbreviation": "NV" | |
}, | |
{ | |
"name": "New Hampshire", | |
"abbreviation": "NH" | |
}, | |
{ | |
"name": "New Jersey", | |
"abbreviation": "NJ" | |
}, | |
{ | |
"name": "New Mexico", | |
"abbreviation": "NM" | |
}, | |
{ | |
"name": "New York", | |
"abbreviation": "NY" | |
}, | |
{ | |
"name": "North Carolina", | |
"abbreviation": "NC" | |
}, | |
{ | |
"name": "North Dakota", | |
"abbreviation": "ND" | |
}, | |
{ | |
"name": "Northern Mariana Islands", | |
"abbreviation": "MP" | |
}, | |
{ | |
"name": "Ohio", | |
"abbreviation": "OH" | |
}, | |
{ | |
"name": "Oklahoma", | |
"abbreviation": "OK" | |
}, | |
{ | |
"name": "Oregon", | |
"abbreviation": "OR" | |
}, | |
{ | |
"name": "Palau", | |
"abbreviation": "PW" | |
}, | |
{ | |
"name": "Pennsylvania", | |
"abbreviation": "PA" | |
}, | |
{ | |
"name": "Puerto Rico", | |
"abbreviation": "PR" | |
}, | |
{ | |
"name": "Rhode Island", | |
"abbreviation": "RI" | |
}, | |
{ | |
"name": "South Carolina", | |
"abbreviation": "SC" | |
}, | |
{ | |
"name": "South Dakota", | |
"abbreviation": "SD" | |
}, | |
{ | |
"name": "Tennessee", | |
"abbreviation": "TN" | |
}, | |
{ | |
"name": "Texas", | |
"abbreviation": "TX" | |
}, | |
{ | |
"name": "Utah", | |
"abbreviation": "UT" | |
}, | |
{ | |
"name": "Vermont", | |
"abbreviation": "VT" | |
}, | |
{ | |
"name": "Virgin Islands", | |
"abbreviation": "VI" | |
}, | |
{ | |
"name": "Virginia", | |
"abbreviation": "VA" | |
}, | |
{ | |
"name": "Washington", | |
"abbreviation": "WA" | |
}, | |
{ | |
"name": "West Virginia", | |
"abbreviation": "WV" | |
}, | |
{ | |
"name": "Wisconsin", | |
"abbreviation": "WI" | |
}, | |
{ | |
"name": "Wyoming", | |
"abbreviation": "WY" | |
} | |
] |
Abbreviations with 2019 populations from the US Census Bureau:
state_hash = {
'AL': 4903185,
'AK': 731545,
'AS': 55312,
'AZ': 7278717,
'AR': 3017804,
'CA': 39512223,
'CO': 5758736,
'CT': 3565287,
'DE': 973764,
'DC': 705749,
'FM': 104929,
'FL': 21477737,
'GA': 10617423,
'GU': 167294,
'HI': 1415872,
'ID': 1787065,
'IL': 12671821,
'IN': 6732219,
'IA': 3155070,
'KS': 2913314,
'KY': 4467673,
'LA': 4648794,
'ME': 1344212,
'MH': 58791,
'MD': 6045680,
'MA': 6892503,
'MI': 9986857,
'MN': 5639632,
'MS': 2976149,
'MO': 6137428,
'MT': 1068778,
'NE': 1934408,
'NV': 3080156,
'NH': 1359711,
'NJ': 8882190,
'NM': 2096829,
'NY': 19453561,
'NC': 10488084,
'ND': 762062,
'MP': 51994,
'OH': 11689100,
'OK': 3956971,
'OR': 4217737,
'PW': 18008,
'PA': 12801989,
'PR': 3193694,
'RI': 1059361,
'SC': 5148714,
'SD': 884659,
'TN': 6829174,
'TX': 28995881,
'UT': 3205958,
'VT': 623989,
'VI': 104578,
'VA': 8535519,
'WA': 7614893,
'WV': 1792147,
'WI': 5822434,
'WY': 578759
};
I am developing an android application and I have a registration form where I am asking for State and City (U.S. only) from the user. How can I use this file in my android app?
@sallu-tech I'm not an android developer, but I'd imagine you'd just read in a JSON file, like any other modern programming language can. Tutorial here: https://www.tutorialspoint.com/android/android_json_parser.htm
@inspectordanno Thank you.
If you need typescript constant to read values into dropdown:
const states = [
{ value: 'AK', name: 'Alaska'},
{ value: 'TX', name: 'Texas'},
{ value: 'AL', name: 'Alabama'},
{ value: 'AR', name: 'Arkansas'},
{ value: 'AZ', name: 'Arizona'},
{ value: 'CA', name: 'California'},
{ value: 'CO', name: 'Colorado'},
{ value: 'CT', name: 'Connecticut'},
{ value: 'DC', name: 'DistrictofColumbia'},
{ value: 'DE', name: 'Delaware'},
{ value: 'FL', name: 'Florida'},
{ value: 'GA', name: 'Georgia'},
{ value: 'HI', name: 'Hawaii'},
{ value: 'IA', name: 'Iowa'},
{ value: 'ID', name: 'Idaho'},
{ value: 'IL', name: 'Illinois'},
{ value: 'IN', name: 'Indiana'},
{ value: 'KS', name: 'Kansas'},
{ value: 'KY', name: 'Kentucky'},
{ value: 'LA', name: 'Louisiana'},
{ value: 'MA', name: 'Massachusetts'},
{ value: 'MD', name: 'Maryland'},
{ value: 'ME', name: 'Maine'},
{ value: 'MI', name: 'Michigan'},
{ value: 'MN', name: 'Minnesota'},
{ value: 'MO', name: 'Missouri'},
{ value: 'MS', name: 'Mississippi'},
{ value: 'MT', name: 'Montana'},
{ value: 'NC', name: 'NorthCarolina'},
{ value: 'ND', name: 'NorthDakota'},
{ value: 'NE', name: 'Nebraska'},
{ value: 'NH', name: 'NewHampshire'},
{ value: 'NJ', name: 'NewJersey'},
{ value: 'NM', name: 'NewMexico'},
{ value: 'NV', name: 'Nevada'},
{ value: 'NY', name: 'NewYork'},
{ value: 'OH', name: 'Ohio'},
{ value: 'OK', name: 'Oklahoma'},
{ value: 'OR', name: 'Oregon'},
{ value: 'PA', name: 'Pennsylvania'},
{ value: 'RI', name: 'RhodeIsland'},
{ value: 'SC', name: 'SouthCarolina'},
{ value: 'SD', name: 'SouthDakota'},
{ value: 'TN', name: 'Tennessee'},
{ value: 'TX', name: 'Texas'},
{ value: 'UT', name: 'Utah'},
{ value: 'VA', name: 'Virginia'},
{ value: 'VT', name: 'Vermont'},
{ value: 'WA', name: 'Washington'},
{ value: 'WI', name: 'Wisconsin'},
{ value: 'WV', name: 'WestVirginia'},
{ value: 'WY', name: 'Wyoming'}
];
thanks !!!
thanks!
Thank you!
@pycoach - Texas is listed twice. On a side note, why do states not have spaces in between words (ex: WestVirginia)?
Thanks for sharing. Really appreciated :p
const states = [ { state_name: "Alabama", state_abbv: "AL", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Alaska", state_abbv: "AK", createdAt: new Date(), updatedAt: new Date() }, { state_name: "American Samoa", state_abbv: "AS", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Arizona", state_abbv: "AZ", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Arkansas", state_abbv: "AR", createdAt: new Date(), updatedAt: new Date() }, { state_name: "California", state_abbv: "CA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Colorado", state_abbv: "CO", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Connecticut", state_abbv: "CT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Delaware", state_abbv: "DE", createdAt: new Date(), updatedAt: new Date() }, { state_name: "District Of Columbia", state_abbv: "DC", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Federated States Of Micronesia", state_abbv: "FM", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Florida", state_abbv: "FL", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Georgia", state_abbv: "GA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Guam", state_abbv: "GU", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Hawaii", state_abbv: "HI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Idaho", state_abbv: "ID", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Illinois", state_abbv: "IL", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Indiana", state_abbv: "IN", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Iowa", state_abbv: "IA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Kansas", state_abbv: "KS", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Kentucky", state_abbv: "KY", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Louisiana", state_abbv: "LA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Maine", state_abbv: "ME", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Marshall Islands", state_abbv: "MH", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Maryland", state_abbv: "MD", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Massachusetts", state_abbv: "MA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Michigan", state_abbv: "MI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Minnesota", state_abbv: "MN", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Mississippi", state_abbv: "MS", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Missouri", state_abbv: "MO", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Montana", state_abbv: "MT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Nebraska", state_abbv: "NE", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Nevada", state_abbv: "NV", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New Hampshire", state_abbv: "NH", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New Jersey", state_abbv: "NJ", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New Mexico", state_abbv: "NM", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New York", state_abbv: "NY", createdAt: new Date(), updatedAt: new Date() }, { state_name: "North Carolina", state_abbv: "NC", createdAt: new Date(), updatedAt: new Date() }, { state_name: "North Dakota", state_abbv: "ND", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Northern Mariana Islands", state_abbv: "MP", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Ohio", state_abbv: "OH", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Oklahoma", state_abbv: "OK", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Oregon", state_abbv: "OR", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Palau", state_abbv: "PW", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Pennsylvania", state_abbv: "PA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Puerto Rico", state_abbv: "PR", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Rhode Island", state_abbv: "RI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "South Carolina", state_abbv: "SC", createdAt: new Date(), updatedAt: new Date() }, { state_name: "South Dakota", state_abbv: "SD", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Tennessee", state_abbv: "TN", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Texas", state_abbv: "TX", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Utah", state_abbv: "UT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Vermont", state_abbv: "VT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Virgin Islands", state_abbv: "VI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Virginia", state_abbv: "VA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Washington", state_abbv: "WA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "West Virginia", state_abbv: "WV", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Wisconsin", state_abbv: "WI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Wyoming", state_abbv: "WY", createdAt: new Date(), updatedAt: new Date() } ]
Thanks for the help! Here's a version for Sequelize migrations
const states = [ { state_name: "Alabama", state_abbv: "AL", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Alaska", state_abbv: "AK", createdAt: new Date(), updatedAt: new Date() }, { state_name: "American Samoa", state_abbv: "AS", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Arizona", state_abbv: "AZ", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Arkansas", state_abbv: "AR", createdAt: new Date(), updatedAt: new Date() }, { state_name: "California", state_abbv: "CA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Colorado", state_abbv: "CO", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Connecticut", state_abbv: "CT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Delaware", state_abbv: "DE", createdAt: new Date(), updatedAt: new Date() }, { state_name: "District Of Columbia", state_abbv: "DC", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Federated States Of Micronesia", state_abbv: "FM", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Florida", state_abbv: "FL", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Georgia", state_abbv: "GA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Guam", state_abbv: "GU", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Hawaii", state_abbv: "HI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Idaho", state_abbv: "ID", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Illinois", state_abbv: "IL", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Indiana", state_abbv: "IN", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Iowa", state_abbv: "IA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Kansas", state_abbv: "KS", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Kentucky", state_abbv: "KY", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Louisiana", state_abbv: "LA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Maine", state_abbv: "ME", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Marshall Islands", state_abbv: "MH", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Maryland", state_abbv: "MD", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Massachusetts", state_abbv: "MA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Michigan", state_abbv: "MI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Minnesota", state_abbv: "MN", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Mississippi", state_abbv: "MS", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Missouri", state_abbv: "MO", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Montana", state_abbv: "MT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Nebraska", state_abbv: "NE", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Nevada", state_abbv: "NV", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New Hampshire", state_abbv: "NH", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New Jersey", state_abbv: "NJ", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New Mexico", state_abbv: "NM", createdAt: new Date(), updatedAt: new Date() }, { state_name: "New York", state_abbv: "NY", createdAt: new Date(), updatedAt: new Date() }, { state_name: "North Carolina", state_abbv: "NC", createdAt: new Date(), updatedAt: new Date() }, { state_name: "North Dakota", state_abbv: "ND", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Northern Mariana Islands", state_abbv: "MP", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Ohio", state_abbv: "OH", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Oklahoma", state_abbv: "OK", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Oregon", state_abbv: "OR", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Palau", state_abbv: "PW", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Pennsylvania", state_abbv: "PA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Puerto Rico", state_abbv: "PR", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Rhode Island", state_abbv: "RI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "South Carolina", state_abbv: "SC", createdAt: new Date(), updatedAt: new Date() }, { state_name: "South Dakota", state_abbv: "SD", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Tennessee", state_abbv: "TN", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Texas", state_abbv: "TX", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Utah", state_abbv: "UT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Vermont", state_abbv: "VT", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Virgin Islands", state_abbv: "VI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Virginia", state_abbv: "VA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Washington", state_abbv: "WA", createdAt: new Date(), updatedAt: new Date() }, { state_name: "West Virginia", state_abbv: "WV", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Wisconsin", state_abbv: "WI", createdAt: new Date(), updatedAt: new Date() }, { state_name: "Wyoming", state_abbv: "WY", createdAt: new Date(), updatedAt: new Date() } ]
Thanks for the help! Here's a version for Sequelize migrations
Great. Thanks man
@KokalaBhanusri
Wyoming
is missing closing quotation andTX
is duplicated.
Corrected it
Thank you
thankyou
9 years later and still helpful!
thank you
This is so obscurely useful, thank you
Easy to copy for lazy developers: https://usastatescode.com/state-array-json
Contains different kind of formats.
Magnificent! Gratz!
What about timezone on each states? Can't find any on web.
What about timezone on each states? Can't find any on web.
9 years everyone and their mother has submitted their own states object. If you make one with time zones, post it here -- someone is guaranteed to find it useful, even if it's 9 years from now.
Thank you, super!
For Django ChoiceField, Abbreviation version ;)
states = [('Select', 'Select One'),("Ak","AK"),("AL","AL"),("AR","AR"),("AZ","AZ"),("CA","CA"),("CO","CO"),("CT","CT"),("DE","DE"),("FL","FL"),("GA","GA"),("HI","HI"),("IA","IA"),("ID","ID"),("IL","IL"),("IN","IN"),("KS","KS"),("KY","KY"),("LA","LA"),("MA","MA"),("MD","MD"),("ME","ME"),("MI","MI"),("MN","MN"),("MO","MO"),("MS","MS"),("MT","MT"),("NC","NC"),("ND","ND"),("NE","NE"), ("NH","NH"),("NJ","NJ"),("NM","NM"),("NV","NV"),("NY","NY"),("OH","OH"),("OK","OK"),("OR","OR"),("PA","PA"),("RI","RI"),("SC","SC"),("SD","SD"),("TN","TN"),("TX","TX"),("UT","UT"),("VA","VA"),("VT","VT"),("WA","WA"),("WI","WI"),("WV","WV"),("WY","WY"),("AS","AS"),("AA","AA"),("AE","AE"),("AP","AP"),("PW","PW"),("DC","DC"),("VI","VI"),("PR","PR"),("FM","FM"),("MP","MP"),("GU","GU")]
THANK YOU VERY MUCH!!!
Thank you so much !!!! <3
Here is a version for react-select
using full state names:
export const states = [
{ label: "Alaska", value: "Alaska" },
{ label: "Alabama", value: "Alabama" },
{ label: "Arkansas", value: "Arkansas" },
{ label: "Arizona", value: "Arizona" },
{ label: "California", value: "California" },
{ label: "Colorado", value: "Colorado" },
{ label: "Connecticut", value: "Connecticut" },
{ label: "District of Columbia", value: "District of Columbia" },
{ label: "Delaware", value: "Delaware" },
{ label: "Florida", value: "Florida" },
{ label: "Georgia", value: "Georgia" },
{ label: "Hawaii", value: "Hawaii" },
{ label: "Iowa", value: "Iowa" },
{ label: "Idaho", value: "Idaho" },
{ label: "IL", value: "Illinois" },
{ label: "Illinois", value: "Indiana" },
{ label: "Kansas", value: "Kansas" },
{ label: "Kentucky", value: "Kentucky" },
{ label: "Louisiana", value: "Louisiana" },
{ label: "Massachusetts", value: "Massachusetts" },
{ label: "Maryland", value: "Maryland" },
{ label: "Maine", value: "Maine" },
{ label: "Michigan", value: "Michigan" },
{ label: "Minnesota", value: "Minnesota" },
{ label: "Missouri", value: "Missouri" },
{ label: "Mississippi", value: "Mississippi" },
{ label: "Montana", value: "Montana" },
{ label: "North Carolina", value: "North Carolina" },
{ label: "North Dakota", value: "North Dakota" },
{ label: "Nebraska", value: "Nebraska" },
{ label: "New Hampshire", value: "New Hampshire" },
{ label: "New Jersey", value: "New Jersey" },
{ label: "New Mexico", value: "New Mexico" },
{ label: "Nevada", value: "Nevada" },
{ label: "New York", value: "NewYork" },
{ label: "Ohio", value: "Ohio" },
{ label: "Oklahoma", value: "Oklahoma" },
{ label: "Oregon", value: "Oregon" },
{ label: "Pennsylvania", value: "Pennsylvania" },
{ label: "Rhode Island", value: "Rhode Island" },
{ label: "South Carolina", value: "South Carolina" },
{ label: "South Dakota", value: "South Dakota" },
{ label: "Tennessee", value: "Tennessee" },
{ label: "Texas", value: "Texas" },
{ label: "Utah", value: "Utah" },
{ label: "Virginia", value: "Virginia" },
{ label: "Vermont", value: "Vermont" },
{ label: "Washington", value: "Washington" },
{ label: "Wisconsin", value: "Wisconsin" },
{ label: "West Virginia", value: "West Virginia" },
{ label: "Wyoming", value: "Wyoming" },
];
If you need typescript constant to read values into dropdown:
const states = [
{ value: 'AK', name: 'Alaska'},
{ value: 'TX', name: 'Texas'},
{ value: 'AL', name: 'Alabama'},
{ value: 'AR', name: 'Arkansas'},
{ value: 'AZ', name: 'Arizona'},
{ value: 'CA', name: 'California'},
{ value: 'CO', name: 'Colorado'},
{ value: 'CT', name: 'Connecticut'},
{ value: 'DC', name: 'DistrictofColumbia'},
{ value: 'DE', name: 'Delaware'},
{ value: 'FL', name: 'Florida'},
{ value: 'GA', name: 'Georgia'},
{ value: 'HI', name: 'Hawaii'},
{ value: 'IA', name: 'Iowa'},
{ value: 'ID', name: 'Idaho'},
{ value: 'IL', name: 'Illinois'},
{ value: 'IN', name: 'Indiana'},
{ value: 'KS', name: 'Kansas'},
{ value: 'KY', name: 'Kentucky'},
{ value: 'LA', name: 'Louisiana'},
{ value: 'MA', name: 'Massachusetts'},
{ value: 'MD', name: 'Maryland'},
{ value: 'ME', name: 'Maine'},
{ value: 'MI', name: 'Michigan'},
{ value: 'MN', name: 'Minnesota'},
{ value: 'MO', name: 'Missouri'},
{ value: 'MS', name: 'Mississippi'},
{ value: 'MT', name: 'Montana'},
{ value: 'NC', name: 'NorthCarolina'},
{ value: 'ND', name: 'NorthDakota'},
{ value: 'NE', name: 'Nebraska'},
{ value: 'NH', name: 'NewHampshire'},
{ value: 'NJ', name: 'NewJersey'},
{ value: 'NM', name: 'NewMexico'},
{ value: 'NV', name: 'Nevada'},
{ value: 'NY', name: 'NewYork'},
{ value: 'OH', name: 'Ohio'},
{ value: 'OK', name: 'Oklahoma'},
{ value: 'OR', name: 'Oregon'},
{ value: 'PA', name: 'Pennsylvania'},
{ value: 'RI', name: 'RhodeIsland'},
{ value: 'SC', name: 'SouthCarolina'},
{ value: 'SD', name: 'SouthDakota'},
{ value: 'TN', name: 'Tennessee'},
{ value: 'TX', name: 'Texas'},
{ value: 'UT', name: 'Utah'},
{ value: 'VA', name: 'Virginia'},
{ value: 'VT', name: 'Vermont'},
{ value: 'WA', name: 'Washington'},
{ value: 'WI', name: 'Wisconsin'},
{ value: 'WV', name: 'WestVirginia'},
{ value: 'WY', name: 'Wyoming'}
];
this has Texas twice, I think ;)
Some states have two zones. And one state (AZ) switches timezones.
Very helpful!!