faker
faker copied to clipboard
Docs improvement for timezone
In documentation, please refer to standard you are using for generating timezones.
E.g. Asia/Rangoon
is not an official IANA code, but is a "symlink" to Asia/Yangon
.
Thanks
Could you please add a reference to the offending method/page in your future issues?
I assume you are referring to https://fakerjs.dev/api/address.html#timeZone Which uses a randomly chosen timezone. https://github.com/faker-js/faker/search?q=Asia%2FRangoon&type=
The documentation has been regenerated since and now uses a different timezone.
So we only have to decide whether the method should return any timezone (official + aliases) or just official ones.
Yes. The same thing goes for the country name. We are using ISO-3166 names and faker is apparently using something different (possibly official UN names?). Please look at Korea as an example
ISO: Korea (the Democratic People's Republic Of) - faker/UN: Democratic People's Republic of Korea (as short and formal) ISO: Korea (the Republic Of) - faker/UN: Republic of Korea (as short and formal)
Thanks for bringing this to our attention. We havent really touched these files since we took faker over. We will probably update these files in v6.2 (soon) along with the other locale files. For now, we are focussing on some remaining technical bugs for 6.1.x.
Here some node packages that we could use as external sources, other suggestions are welcome: Timezone: https://www.npmjs.com/package/tzdata Country code: https://www.npmjs.com/package/country-codes-list
Our app is also running into this issue.
When a test user is seeded with a symlink time zone and not a 'real' time zone, various timing functionality in the app breaks because, in our case, Luxon doesn't operate as expected when passed a non-IANA time zone name.
To access IANA timezones we use:
import { rawTimeZones, RawTimeZone /* For Typescript */ } from '@vvo/tzdb';
Team decision
use only official ones. Extract locales from en,... and move to global/method scope.