File size: 490 Bytes
d739b1b
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
/** ์ €์žฅ ์‹œ IANA ์‹œ๊ฐ„๋Œ€๋ฅผ ๊ณ ์ •ํ•˜์—ฌ ์žฌ์‹œ์ž‘/ํ˜ธ์ŠคํŠธ ์‹œ๊ฐ„๋Œ€ ๋ณ€๊ฒฝ์— ์˜ํ–ฅ์„ ๋ฐ›์ง€ ์•Š๊ฒŒ ํ•œ๋‹ค. */
function batchTimezone(value, existing) {
  const timezone = value == null ? existing || Intl.DateTimeFormat().resolvedOptions().timeZone : value;
  if (typeof timezone !== 'string' || !timezone) throw new Error('Batch timezone is required');
  new Intl.DateTimeFormat('en-US', { timeZone: timezone }).format();
  return timezone;
}
module.exports = { batchTimezone };