From c3c291644965203e08b6887fb054ff1bb6919e4d Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 25 May 2017 18:26:42 +0100 Subject: [PATCH] Use array literals --- src/DateUtils.js | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/DateUtils.js b/src/DateUtils.js index be5f432d06..46dda6aeb4 100644 --- a/src/DateUtils.js +++ b/src/DateUtils.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2017 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,32 +19,32 @@ limitations under the License. import { _t } from './languageHandler'; function getDaysArray() { - var days = []; - days.push(_t('Sun')); - days.push(_t('Mon')); - days.push(_t('Tue')); - days.push(_t('Wed')); - days.push(_t('Thu')); - days.push(_t('Fri')); - days.push(_t('Sat')); - return days; + return [ + _t('Sun'), + _t('Mon'), + _t('Tue'), + _t('Wed'), + _t('Thu'), + _t('Fri'), + _t('Sat'), + ]; } function getMonthsArray() { - var months = []; - months.push(_t('Jan')); - months.push(_t('Feb')); - months.push(_t('Mar')); - months.push(_t('Apr')); - months.push(_t('May')); - months.push(_t('Jun')); - months.push(_t('Jul')); - months.push(_t('Aug')); - months.push(_t('Sep')); - months.push(_t('Oct')); - months.push(_t('Nov')); - months.push(_t('Dec')); - return months; + return [ + _t('Jan'), + _t('Feb'), + _t('Mar'), + _t('Apr'), + _t('May'), + _t('Jun'), + _t('Jul'), + _t('Aug'), + _t('Sep'), + _t('Oct'), + _t('Nov'), + _t('Dec'), + ]; } function pad(n) {