Is there a way to check if timezone name valid or not in JavaScript without using external library?
When user enters timezone name in text field I want to verify whether zone is valid or not?
I know we can do it easily using moment-timezone library. But I don't want to use any extra library. I'm looking for pure JavaScript way.
isValidTimeZone(name) {
//return true/false
}
isValidTimeZone('Asia/Colombo'); //returns true
isValidTimeZone('America/Los_Angeles'); //returns true
isValidTimeZone('MyTimeZone/ME'); //returns false