This commit is contained in:
ChomeNS 2022-12-30 20:47:17 +07:00
parent 059d1e201b
commit 0e706e7251

View file

@ -12,9 +12,9 @@ module.exports = {
const momented = moment().tz(timezone).format(format)
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
if (momented === moment().format(format) &&
(timezone.toLowerCase() === 'asia/bangkok' ||
timezone.toLowerCase() === 'utc' ||
timezone.toLowerCase() === 'america/new_york'
(timezone.toLowerCase() !== 'asia/bangkok' ||
timezone.toLowerCase() !== 'utc' ||
timezone.toLowerCase() !== 'america/new_york'
)
) {
throw new SyntaxError('Invalid timezone')
@ -28,9 +28,9 @@ module.exports = {
const momented = moment().tz(timezone).format(format)
const description = `The current date and time for the timezone ${timezone} is: ${momented}`
if (momented === moment().format(format) &&
(timezone.toLowerCase() === 'asia/bangkok' ||
timezone.toLowerCase() === 'utc' ||
timezone.toLowerCase() === 'america/new_york'
(timezone.toLowerCase() !== 'asia/bangkok' ||
timezone.toLowerCase() !== 'utc' ||
timezone.toLowerCase() !== 'america/new_york'
)
) {
throw new SyntaxError('Invalid timezone')