| 16 | // under the License. |
| 17 | |
| 18 | function loadTimeZone () { |
| 19 | const timeZoneJson = require.context('./', true, /[A-Za-z0-9-_,\s]+\.json$/i) |
| 20 | const data = [] |
| 21 | |
| 22 | timeZoneJson.keys().forEach(key => { |
| 23 | const matched = key.match(/([A-Za-z0-9-_]+)\./i) |
| 24 | if (matched && matched.length > 1) { |
| 25 | const json = timeZoneJson(key) |
| 26 | for (const index in json) { |
| 27 | data.push({ |
| 28 | id: index, |
| 29 | name: json[index] |
| 30 | }) |
| 31 | } |
| 32 | } |
| 33 | }) |
| 34 | |
| 35 | return data |
| 36 | } |
| 37 | |
| 38 | function getFullTimeZone (strQuery) { |
| 39 | if (!strQuery || strQuery === '') { |