This is simple code which can save some of your time, if you trying to build Select field for timezones. Find below for complete Timezones code

Timezones

Find below for Timezones.js which contains all timezone names and values
export default [
    {"value":"America/Adak","name":"Adak"},
    {"value":"America/Anchorage","name":"Anchorage"},
    {"value":"America/Anguilla","name":"Anguilla"},
    {"value":"America/Antigua","name":"Antigua"},
    .....
  ];

Normal Select Box

This normal select box in which Timezones were mapped as options
<select value={this.state.timezone} onChange={this.onSelect}>
           {Timezones.map((timezone) => <option value={timezone.value}>{timezone.name}</option>)}
</select>

React-bootstrap Select box

This Select box uses bootstrap styles and components
<FormControl value={this.state.timezone} onChange={this.onSelect} componentClass="select" placeholder="select">
    {Timezones.map((timezone) => <option value={timezone.value}>{timezone.name}</option>)}
</FormControl>

React-select Select box

react-select is React version of Select2. 
<Select value={this.state.timezone} onChange={this.onSelect2} placeholder="select" options={Timezones} labelKey="name" valueKey="value">
</Select>

Complete component code

import 'bootstrap/dist/css/bootstrap.min.css';
import 'react-select/dist/react-select.min.css';
import React from 'react';
import Timezones from './Timezones';
import {FormControl} from 'react-bootstrap';
import Select from 'react-select';

export default class App extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      timezone:'America/Aruba'
    }
    this.onSelect = this.onSelect.bind(this);
    this.onSelect2 = this.onSelect2.bind(this);
  }

  onSelect(event) {
    this.setState({
      timezone:event.target.value
    });
  }

  onSelect2(language) {
    this.setState({
      timezone:language.value
    });
  }

  render() {
    return (
      <div>
        <h1>Select box for Timezones</h1>
        <select value={this.state.timezone} onChange={this.onSelect}>
           {Timezones.map((timezone) => <option value={timezone.value}>{timezone.name}</option>)}
        </select>
        <br/><br/><br/>
        <h1>Bootstrap Select box for Timezones</h1>
        <FormControl value={this.state.timezone} onChange={this.onSelect} componentClass="select" placeholder="select">
          {Timezones.map((timezone) => <option value={timezone.value}>{timezone.name}</option>)}
        </FormControl>
        <br/><br/><br/>
        <h1>React Select2 for Timezones</h1>
        <Select value={this.state.timezone} onChange={this.onSelect2} placeholder="select"
           options={Timezones} labelKey="name" valueKey="value">
        </Select>
      </div>
    )
  }
}

58 comments:

  1. Hi there, You've done an incredible job. I will definitely digg it and in my view suggest to my friends.I am sure they will be benefited from this web site.
    kissmanga

    ReplyDelete
  2. nice blog...looking for more useful information....For Online accounting services please visit here:
    https://meralegal.com/accounting.php

    ReplyDelete
  3. Thank you for this informative post

    Get Six Sigma Certification Online with HenryHarvin.
    Learn from experts and be on top

    ReplyDelete
  4. ERP Gold Software
    How ERP Gold works as an inventory management software for Walmart
    Why do sellers on Walmart need inventory management software?
    Inventory management involves the process of ordering, handling, storing, and processing a company’s inventory. This has done because, without an effective inventory management system, the full potential of the supply chain becomes unattainable.
    For more information about ERP Gold inventory management software, please click on the link below.
    https://www.erp.gold/walmart-erp-integration-software/

    ReplyDelete
  5. Thanks for sharing a really very nice and wonderful article i like your blog too much

    ReplyDelete
  6. Thank you for sharing your info. I really appreciate your efforts and I am waiting for your further write ups thank you once again.Electrical design for building construction


    ReplyDelete
  7. Have seen this thing on a few different website and wanted to do it for some time. Now I can say I am able to do it efficiently:
    buy logo

    ReplyDelete
  8. I really like your blog thanks for sharing...and i have some information about Ambience Courtyard developed by Koncept Ambience Group, located in Manikonda, Hyderabad. Project provides 2,2.5 & 3bhk bedroom luxury flats available for sale in affordable prices.

    Ambience Courtyard
    Ambience Courtyard Hyderabad
    Ambience Courtyard Manikonda
    Ambience Courtyard Manikonda Hyderabad


    ReplyDelete
  9. I enjoyed reading your post.You make so many great points here that I read your article a couple of times.
    Luxury Park 2
    Luxury Park 2 Mamidipally
    Luxury Park 2 Hyderabad

    ReplyDelete
  10. Many thanks for the article, I have a lot of spray lining knowledge but always learn something new. Keep up the good work and thank you again. ํ† ํ† ์‚ฌ์ดํŠธ

    ReplyDelete
  11. I’m writing on this topic these days, , but I have stopped writing because there is no reference material. Then I accidentally found your article. I can refer to a variety of materials, so I think the work I was preparing will work! Thank you for your efforts. ๊ฒฝ๋งˆ์‚ฌ์ดํŠธ

    ReplyDelete
  12. My name is Upan, I have more than 3 years of experience in Shopify dropshipping store development and products listing. I help my clients to boost their sales by importing the best product reviews for their products.

    Will you import reviews from aliexpress to shopify?
    Order Link: https://www.fiverr.com/share/XmW1Em

    ReplyDelete
  13. I like your written way thanks for sharing it with us.


    law dissertation Writers

    ReplyDelete
  14. Thank you so much for this information.

    https://imageexpertindia.com/long-shadow-photoshop-basic-tutorial/
    Creating a drop shadow is a cycle that ought to go with your section as it assists with making your picture look more reasonable. This little realistic detail can truly have an effect since it makes the item more straightforward to examine.

    Reflection Shadow
    Photoshop Shadow Effect Service
    Natural Drop Shadow Service
    Realistic shadow in photoshop
    Floating Shadow Creation
    Castaway Shadow Creation

    ReplyDelete
  15. "This is a really good write up . I loved it .
    Excellent article . Keep up the good work
    Thank you.
    "
    https://groundcyber.com/digital-marketing-course-bareilly/

    ReplyDelete
  16. Servis PK is an Online Official Store, where you can buy formal shoes for men in all sizes with various colors at reasonable Prices. We deliver a product on COD in all Metro cities like Lahore, Karachi, Islamabad across Pakistan.

    ReplyDelete
  17. Thank you for your insight! https://firstclass.marketing/

    ReplyDelete
  18. I dark web sites
    have more than 3 years of experience in Shopify

    ReplyDelete
  19. A Time zones Select Box using React simplifies user interactions, providing a seamless experience to choose and display time zones effectively, enhancing the overall usability of the application. ipad price in bd

    ReplyDelete
  20. "This is a really good write up . I loved it .
    Health tips

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. Thanks for sharing a really very nice and wonderful article i like your blog too much

    live score

    ReplyDelete
  23. very nice and wonderful article i like your blog....Rajshahi College

    ReplyDelete
  24. Thanks for sharing for your valuable information.Thanks for this blog .imdb.comThis information is very helpful. I'm always looking for new fashion trends to try out. Everyone wants better earning opportunities but at the same time wants to carry the valued Work and career mentor factor along.football player I am expecting more such kind of posting from the writer So Nice.

    ReplyDelete
  25. The most common type of exoplanet that we've discovered so far are called "super-Earths" or "mini-Neptunes.

    ReplyDelete
  26. Thanks for sharing for your valuable information.Thanks for this blog .imdb.comThis information is very helpful. I'm always looking for new fashion trends to try out. Everyone wants better earning opportunities but at the same time wants to carry the valued Work and career mentor factor along.football player I am expecting more such kind of posting from the writer So Nice.Rajshahi Digital marketing


    ReplyDelete
  27. I'm convinced that reading this post adds +10 IQ points..
    Global warming

    ReplyDelete
  28. Have seen this thing on a few different website and wanted to do it for some time. Now I can say I am able to do it efficiently: Rajshahi IT Center

    ReplyDelete
  29. Thanks for your useful post.https://www.pinterest.com

    ReplyDelete
  30. thank you for taking the time to create and submit your valuable website social media<>a href="http://www.bditinstitute.com/"">bdit

    ReplyDelete
  31. Regularly updating the blog keeps the audience engaged and interested Daraz here

    ReplyDelete
  32. This is simple code which can save some of your time, if you trying to build Select field for time zones.car price

    ReplyDelete
  33. we need some usefull content thank.man

    ReplyDelete
  34. This comment has been removed by the author.

    ReplyDelete
  35. At BedsHeaven.com, each piece is a masterpiece crafted with precision and passion. Our artisans pour their expertise into every stitch, ensuring that each bedsheet tells a story of unparalleled craftsmanship. The attention to detail is not just a choice; it's our commitment to delivering an experience that transcends the ordinary.

    ReplyDelete
  36. This is truly a decent and enlightening, containing all data furthermore greatly affects the new innovation.bd freelancing IT

    ReplyDelete
  37. Delhi NCR, a bustling metropolis, serves as a gateway to the world, and the choice of an airline can significantly impact your travel experience. Let's navigate the skies and discover the top airline companies in Delhi NCR, ensuring your journey is not just a destination but an adventure.

    1. Air India: A Legacy of Excellence
    Embark on a journey steeped in tradition with Air India, an airline synonymous with reliability and excellence. With a rich legacy and a commitment to passenger satisfaction, Air India stands as a stalwart in the aviation landscape of Delhi NCR.

    2. IndiGo: Where Efficiency Meets Comfort
    IndiGo, a name synonymous with punctuality and passenger comfort, has earned its stripes as a preferred choice for travelers. With a modern fleet and a dedication to seamless travel experiences, IndiGo ensures your journey is as enjoyable as your destination.

    3. Vistara: Elegance in the Skies
    Step into the world of Vistara, where elegance takes flight. Offering a perfect blend of luxury and efficiency, Vistara has carved a niche for itself among the top airlines in Delhi NCR. Your journey becomes a seamless experience of sophistication and comfort.

    4. SpiceJet: Redefining Affordable Travel
    For those seeking a perfect blend of affordability and luxury, SpiceJet emerges as a frontrunner. With a commitment to providing cost-effective travel solutions without compromising on quality, SpiceJet caters to the savvy traveler in Delhi NCR.

    5. GoAir: Bridging Affordability and Excellence
    GoAir, a dynamic player in the aviation industry, is committed to delivering excellence with a focus on affordability. For travelers in Delhi NCR, GoAir stands out as a reliable choice, offering a harmonious balance between cost-efficiency and service quality.

    As you plan your next adventure, consider these airlines as your wings, propelling you toward unparalleled travel experiences from the heart of Delhi NCR.

    Title: Solo Sojourns: Exploring the Less Glamorous Side of Independent Travel

    Solo travel, often romanticized for its liberating nature, isn't always a seamless journey. Beyond the Instagram-worthy moments lie aspects that solo travelers may find challenging. Let's delve into the less glamorous side of solo travel and explore what some individuals dislike most about embarking on solitary adventures.

    1. The Loneliness Quotient:
    Solo travel can be a lonely affair, especially when there's no one to share the awe-inspiring moments or exchange thoughts about a new culture. The absence of companionship can sometimes overshadow the joy of exploration.

    2. Safety Concerns:
    Navigating unfamiliar territories alone can raise safety concerns for solo travelers. The responsibility of personal security, particularly in unknown environments, can add an extra layer of stress to the journey.

    3. Dining Solo Dilemma:
    While solo travelers have the freedom to savor local cuisines, dining alone can be less enjoyable for some. The absence of shared meals and the communal experience of enjoying food can make dining a solo affair less fulfilling.

    4. Missing Shared Memories:
    Solo travelers often find themselves yearning for shared experiences. The absence of a companion to witness and reminisce about the spectacular landscapes and cultural wonders can leave a void in the overall travel experience.

    5. Decision Fatigue:
    Being the sole decision-maker for every aspect of the journey, from planning itineraries to choosing accommodations, can lead to decision fatigue. Some solo travelers express a desire to share the responsibility of navigating choices with a travel companion.

    Solo travel is undoubtedly a transformative experience, but acknowledging these challenges adds depth to the narrative. It's a personal journey, and finding a balance between independence and shared moments is the key to crafting a fulfilling solo adventure.

    ReplyDelete
  38. 3Aๅจ›ๆจ‚ๅŸŽๆ–ฐๆœƒๅ“กไบซ้ฆ–ๆฌกๅ„ฒๅ€ผ1000้€1000,่€่™ŽๆฉŸๅ…่ฝ‰้€8888,็™พๅฎถ้€ฃๅ‹้€99999,็บŒๅ„ฒๅ†้€20 ๅ„ชๆƒ ๅฝฉ้‡‘,็„ก้ขจ้šชๆŠผ็ขผ。3Aๅจ›ๆจ‚ๅŸŽๆ“ๆœ‰่ฟ‘ๅƒๅ ด็ฒพๅฝฉ้ซ”่‚ฒ่ณฝไบ‹,ๆ›ดๆœ‰็œŸไบบ、ๅฝฉ็ฅจ、้›ปๅญ้Šๆˆฒ็ญ‰ๅคš็จฎๅจ›ๆจ‚ๆ–นๅผ้ธๆ“‡,่ฎ“ๆ‚จๆ“ๆœ‰ๅฎŒ็พŽ้Šๆˆฒ้ซ”้ฉ—,ๅฟซไพ†3Aๅจ›ๆจ‚ๅŸŽ่จปๅ†Š้ ˜ๅฅฝ็ฆฎ!3Aๅจ›ๆจ‚ๅŸŽ

    ReplyDelete
  39. thank you for explaining so beautifully

    ReplyDelete
  40. Discover the C Program to Swap Two Numbers Using Pointer. Understand the efficient use of pointers in swapping and enhance your C programming skills.

    ReplyDelete
  41. This is truly a decent and enlightening, containing all data furthermore greatly affects the new innovation.bd freelancing IT Facebook

    ReplyDelete

Blogroll

Popular Posts