Luxon: IANAZone.isValidSpecifier should support more than 2 components in the name

Created on 23 Mar 2018  路  3Comments  路  Source: moment/luxon

There are timezone names like "America/Argentina/Ushuaia" or "America/Indiana/Indianapolis".

I think the regexp should be
/^[a-z_+-]{1,256}(\/[a-z_+-]{1,256})+$/i
or
/^[a-z_+-]{1,256}\/[a-z_+-]{1,256}(\/[a-z_+-]{1,256})?$/i

at line https://github.com/moment/luxon/blob/e77f74f27fae1237a5b59b1df15e4114215f665c/src/zones/IANAZone.js#L57

good first contribution bug up for grabs

Most helpful comment

Fixed in #234. Will release it soon.

All 3 comments

Hi @emanuelegalbiati I would like to take this up. I will create a PR for this.

Fixed in #234. Will release it soon.

Released in 1.1.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathanborges picture jonathanborges  路  6Comments

thetuyen picture thetuyen  路  4Comments

tamirvs picture tamirvs  路  5Comments

dnalborczyk picture dnalborczyk  路  3Comments

UnsungHero97 picture UnsungHero97  路  5Comments