Commit acd509a2ae09f449da7daf8bc31faf4d954c5f76

Authored by Administrator
1 parent 8799ab32

090316

src/app/backend/controllers/SeoController.php
@@ -156,4 +156,27 @@ class SeoController extends \Phalcon\Mvc\Controller @@ -156,4 +156,27 @@ class SeoController extends \Phalcon\Mvc\Controller
156 exit; 156 exit;
157 } 157 }
158 158
  159 +
  160 + function setReconciliationAction(){
  161 + if( !$this->session->get('isAdminAuth') )
  162 + {
  163 + return $this->response->redirect([ 'for' => 'admin_login' ]);
  164 + }
  165 +
  166 + $post['text'] = $this->request->getPost('text', 'string', NULL );
  167 + if(!(empty($post['text']))){
  168 + $this->models->getManagerMail()->UpdateData($post);
  169 +
  170 + $data = $this->models->getManagerMail()->getData();
  171 +
  172 + return $this->response->redirect([ 'for' => 'set_reconciliation','page' => $data[0] ]);
  173 + } else {
  174 + $data = $this->models->getManagerMail()->getData();
  175 +
  176 + $this->view->setVars([
  177 + 'page' => $data[0]
  178 + ]);
  179 + }
  180 + }
  181 +
159 } 182 }
160 \ No newline at end of file 183 \ No newline at end of file
src/app/backend/views/partial/sidebar.php
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'excel_worker_index' ]) ?>" title="Парсер"></a></li> 14 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'excel_worker_index' ]) ?>" title="Парсер"></a></li>
15 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'excel_worker_index' ]) ?>" title="Парсер"></a></li> 15 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'excel_worker_index' ]) ?>" title="Парсер"></a></li>
16 <li class="point6"><a href="<?= $this->url->get([ 'for' => 'slider_index' ]) ?>" title="Банера"></a></li> 16 <li class="point6"><a href="<?= $this->url->get([ 'for' => 'slider_index' ]) ?>" title="Банера"></a></li>
17 - <li class="point7"><a href="<?= $this->url->get([ 'for' => 'banner_index' ]) ?>" title="Рекламный баннер"></a></li> 17 + <li class="point7"><a href="<?= $this->url->get([ 'for' => 'banner_index' ]) ?>" title="Редактировать эмейлы для сверки"></a></li>
18 </ul> 18 </ul>
19 19
20 <ul class="head"> 20 <ul class="head">
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
29 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_price_list' ]) ?>" title="Выгрузка для динамического ремаркетинга"></a></li> 29 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_price_list' ]) ?>" title="Выгрузка для динамического ремаркетинга"></a></li>
30 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_users_list' ]) ?>" title="Выгрузка пользователей"></a></li> 30 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_users_list' ]) ?>" title="Выгрузка пользователей"></a></li>
31 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'set_pdf_file' ]) ?>" title="Загрузить PDF файл"></a></li> 31 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'set_pdf_file' ]) ?>" title="Загрузить PDF файл"></a></li>
  32 + <li class="point4"><a href="<?= $this->url->get([ 'for' => 'set_reconciliation' ]) ?>" title="Загрузить PDF файл"></a></li>
32 </ul> 33 </ul>
33 </div> 34 </div>
34 </div> 35 </div>
@@ -67,6 +68,7 @@ @@ -67,6 +68,7 @@
67 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_price_list' ]) ?>" title="Выгрузка для динамического ремаркетинга">Динамический ремаркетинг</a></li> 68 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_price_list' ]) ?>" title="Выгрузка для динамического ремаркетинга">Динамический ремаркетинг</a></li>
68 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_users_list' ]) ?>" title="Выгрузка пользователей">Выгрузка пользователей</a></li> 69 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'get_users_list' ]) ?>" title="Выгрузка пользователей">Выгрузка пользователей</a></li>
69 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'set_pdf_file' ]) ?>" title="Загрузить PDF файл">Загрузить PDF файл</a></li> 70 <li class="point4"><a href="<?= $this->url->get([ 'for' => 'set_pdf_file' ]) ?>" title="Загрузить PDF файл">Загрузить PDF файл</a></li>
  71 + <li class="point4"><a href="<?= $this->url->get([ 'for' => 'set_reconciliation' ]) ?>" title="Редактировать эмейлы для сверки">Редактировать эмейлы для сверки</a></li>
70 </ul> 72 </ul>
71 </div> 73 </div>
72 </div> 74 </div>
73 \ No newline at end of file 75 \ No newline at end of file
src/app/backend/views/promo_codes/addEdit.php
@@ -142,6 +142,7 @@ @@ -142,6 +142,7 @@
142 </div> 142 </div>
143 </div> 143 </div>
144 <script> 144 <script>
  145 +
145 var datepicker = { 146 var datepicker = {
146 dateFormat: "dd-mm-yy" 147 dateFormat: "dd-mm-yy"
147 }; 148 };
src/app/backend/views/seo/setReconciliation.php 0 → 100644
  1 +<div id="addEdit">
  2 + <div class="inner"><?= $this->flash->output(); ?></div>
  3 + <div class="inner">
  4 + <div class="sidebar_content_wrapper clearfix">
  5 + <div class="sidebar_wrapper float">
  6 + <div class="sidebar clearfix">
  7 + <?= $this->partial('partial/sidebar') ?>
  8 + </div>
  9 + </div>
  10 + <div class="content_wrapper float">
  11 + <div class="content_wrapper_list clearfix">
  12 + <div class="table_name header_gradient"></div>
  13 +
  14 + <div class="table_pages_wrapper">
  15 + <form enctype="multipart/form-data" method="post" action="/set_reconciliation" id="email_event_add_edit">
  16 +
  17 + <div class="clearfix input_wrapper">
  18 + <div class="label"><label for="name">Эмейлы*</label></div>
  19 + <div class="input"><textarea name="text"><?= $page['text']?></textarea></div>
  20 + </div>
  21 + <div class="clearfix submit_wrapper">
  22 + <input type="submit" class="news_submit float" name="save" value="Сохранить">
  23 + </div>
  24 +
  25 + </form>
  26 + </div>
  27 + </div>
  28 + </div>
  29 + </div>
  30 + </div>
  31 +</div>
0 \ No newline at end of file 32 \ No newline at end of file
src/app/frontend/controllers/DealerController.php
@@ -1542,7 +1542,45 @@ class DealerController extends \controllers\ControllerBase @@ -1542,7 +1542,45 @@ class DealerController extends \controllers\ControllerBase
1542 } 1542 }
1543 1543
1544 public function financialCalculationsAction() { 1544 public function financialCalculationsAction() {
1545 - $customer_id = $this->session->get('id'); 1545 + $callback['id'] = $customer_id = $this->session->get('id');
  1546 +
  1547 + if( $this->request->isPost() )
  1548 + {
  1549 +
  1550 +
  1551 + $callback['name'] = $this->request->getPost('name', 'string', NULL );
  1552 + $email = $this->request->getPost('email', 'string', NULL );
  1553 + $callback['date'] = $this->request->getPost('date', 'string', NULL );
  1554 + $callback['phone'] = $this->request->getPost('phone', 'string', NULL );
  1555 + $callback['comments'] = $this->request->getPost('comments', 'string', NULL );
  1556 + $callback['email'] = filter_var( $email, FILTER_VALIDATE_EMAIL );
  1557 +
  1558 +
  1559 + if( !empty( $callback['name'] ) && !empty( $callback['date'] ) && ( !empty( $callback['email'] ) || !empty( $callback['phone'] ) ) )
  1560 + {
  1561 + if( $callback_id = $this->models->getCallback()->addCallback($callback) )
  1562 + {
  1563 + $callback['callback_id'] = $callback_id['0']['id'];
  1564 +
  1565 + if( !empty( $callback['email'] ) )
  1566 + {
  1567 + $data = $this->models->getManagerMail()->getData();
  1568 + $this->sendmail->addCustomer( 9, $callback,$data );
  1569 + }
  1570 +
  1571 +
  1572 + setcookie("callback", '1', time()+3600);
  1573 +
  1574 + $this->flash->success($this->languages->getTranslation()->_("please_change_the_password"));
  1575 + }
  1576 + }
  1577 +// else
  1578 +// {
  1579 +// $this->session->set( 'callback', $callback );
  1580 +// $this->flash->error( $this->languages->getTranslation()->_("required_error"));
  1581 +// return $this->response->redirect([ 'for' => 'callback_errors', 'language' => $this->lang_name ]);
  1582 +// }
  1583 + }
1546 1584
1547 $payment = $this->models->getPayment()->getPaymentByCustomer($customer_id); 1585 $payment = $this->models->getPayment()->getPaymentByCustomer($customer_id);
1548 1586
src/app/frontend/messages/ru.php
@@ -341,5 +341,7 @@ return array( @@ -341,5 +341,7 @@ return array(
341 'order_blank' => 'Бланк заказа', 341 'order_blank' => 'Бланк заказа',
342 'refund' => 'Возврат', 342 'refund' => 'Возврат',
343 'sale' => 'Реализация', 343 'sale' => 'Реализация',
344 - 'payment' => 'Оплата' 344 + 'payment' => 'Оплата',
  345 + "file_download_link" => "Загрузить каталог",
  346 + "reconciliation" => "заказать сверку",
345 ); 347 );
346 \ No newline at end of file 348 \ No newline at end of file
src/app/frontend/messages/ua.php
@@ -370,5 +370,7 @@ return array( @@ -370,5 +370,7 @@ return array(
370 'order_blank' => 'Бланк замовлення', 370 'order_blank' => 'Бланк замовлення',
371 'refund' => 'Повернення', 371 'refund' => 'Повернення',
372 'sale' => 'Реалізація', 372 'sale' => 'Реалізація',
373 - 'payment' => 'Оплата' 373 + 'payment' => 'Оплата',
  374 + "file_download_link" => "Завантажити каталог",
  375 + "reconciliation" => "замовити звірку",
374 ); 376 );
375 \ No newline at end of file 377 \ No newline at end of file
src/app/frontend/views/dealer/financialCalculations.php
@@ -3,6 +3,17 @@ @@ -3,6 +3,17 @@
3 </h2> 3 </h2>
4 <section style="overflow: visible" class="content"> 4 <section style="overflow: visible" class="content">
5 <div class="main_block"> 5 <div class="main_block">
  6 + <div class="form-group">
  7 + <div class="input-group">
  8 + <div class="input-group-addon">
  9 + <i class="fa fa-calendar"></i>
  10 + </div>
  11 + <input type="text" class="form-control custom_width" id="reservation">
  12 + <a href="#" class="green_but orders_data_request" data-toggle="modal" data-target="#myModal" ><?= $t->_('reconciliation') ?></a>
  13 + </div>
  14 + <!-- /.input group -->
  15 + </div>
  16 +
6 <div class="fin_content"> 17 <div class="fin_content">
7 18
8 <div class="line l_one"> 19 <div class="line l_one">
@@ -24,18 +35,18 @@ @@ -24,18 +35,18 @@
24 </div> 35 </div>
25 <div class="fin_cell c_two money"> 36 <div class="fin_cell c_two money">
26 <?php if($item['amount'] > 0): ?> 37 <?php if($item['amount'] > 0): ?>
27 - <span><?= $item['amount'] ?></span> грн. 38 + <span class="count" data-count="<?= $item['amount'] ?>"><?= $item['amount'] ?></span> грн.
28 <?php endif; ?> 39 <?php endif; ?>
29 </div> 40 </div>
30 <div class="fin_cell c_two money"> 41 <div class="fin_cell c_two money">
31 <?php if($item['amount'] < 0): ?> 42 <?php if($item['amount'] < 0): ?>
32 - <span><?= -$item['amount'] ?></span> грн. 43 + <span class="pay" data-pay="<?= -$item['amount'] ?>"><?= -$item['amount'] ?></span> грн.
33 <?php endif; ?> 44 <?php endif; ?>
34 </div> 45 </div>
35 <div style="color: #333" class="fin_cell c_two money"> 46 <div style="color: #333" class="fin_cell c_two money">
36 <?= $t->_($item['type']) ?> 47 <?= $t->_($item['type']) ?>
37 </div> 48 </div>
38 - <div style="color: #333" class="fin_cell c_two money"> 49 + <div style="color: #333" class="date fin_cell c_two money" data-date="<?= date('d.m.Y', strtotime($item['date'])) ?>">
39 <?= date('d.m.Y', strtotime($item['date'])) ?> 50 <?= date('d.m.Y', strtotime($item['date'])) ?>
40 </div> 51 </div>
41 </div> 52 </div>
@@ -46,15 +57,172 @@ @@ -46,15 +57,172 @@
46 <div class="lines_final"> 57 <div class="lines_final">
47 <div class="line final_one"> 58 <div class="line final_one">
48 <div style="box-sizing:border-box;height: 39px;width: 171px;max-width: 171px" class="fin_cell c_one"><span><?= $t->_('sum') ?></span></div> 59 <div style="box-sizing:border-box;height: 39px;width: 171px;max-width: 171px" class="fin_cell c_one"><span><?= $t->_('sum') ?></span></div>
49 - <div class="fin_cell c_two money"><span><?= $sum_order ?></span> грн.</div>  
50 - <div class="fin_cell c_two money"><span><?= $sum_paid ?></span> грн.</div> 60 + <div class="fin_cell c_two money"><span id="sum"><?= $sum_order ?></span> грн.</div>
  61 + <div class="fin_cell c_two money"><span id="paid"><?= $sum_paid ?></span> грн.</div>
51 </div> 62 </div>
52 <div class="line final_two"> 63 <div class="line final_two">
53 <div class="fin_cell c_one"><span>Сальдо</span></div> 64 <div class="fin_cell c_one"><span>Сальдо</span></div>
54 - <div class="fin_cell balance"><span><?= $sum_paid - $sum_order ?></span> грн.</div> 65 + <div class="fin_cell balance"><span id="result"><?= $sum_paid - $sum_order ?></span> грн.</div>
55 </div> 66 </div>
56 </div> 67 </div>
57 </div> 68 </div>
58 69
59 </div> 70 </div>
60 -</section>  
61 \ No newline at end of file 71 \ No newline at end of file
  72 +</section>
  73 +
  74 +
  75 +
  76 +<script src="/plugins/daterangepicker/moment.js"></script>
  77 +<script src="/plugins/daterangepicker/daterangepicker.js"></script>
  78 +<script>
  79 +
  80 + moment.locale('ru', {
  81 + months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
  82 + monthsShort :'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
  83 + weekdays : 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
  84 + weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  85 + weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  86 + longDateFormat : {
  87 + LT : 'HH:mm',
  88 + LTS : 'HH:mm:ss',
  89 + L : 'DD.MM.YYYY',
  90 + LL : 'D MMMM YYYY г.',
  91 + LLL : 'D MMMM YYYY г., HH:mm',
  92 + LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  93 + },
  94 + calendar : {
  95 + sameDay: '[Сегодня в] LT',
  96 + nextDay: '[Завтра в] LT',
  97 + lastDay: '[Вчера в] LT',
  98 + nextWeek: function (now) {
  99 + if (now.week() !== this.week()) {
  100 + switch (this.day()) {
  101 + case 0:
  102 + return '[В следующее] dddd [в] LT';
  103 + case 1:
  104 + case 2:
  105 + case 4:
  106 + return '[В следующий] dddd [в] LT';
  107 + case 3:
  108 + case 5:
  109 + case 6:
  110 + return '[В следующую] dddd [в] LT';
  111 + }
  112 + } else {
  113 + if (this.day() === 2) {
  114 + return '[Во] dddd [в] LT';
  115 + } else {
  116 + return '[В] dddd [в] LT';
  117 + }
  118 + }
  119 + },
  120 + relativeTime : {
  121 + future : 'через %s',
  122 + past : '%s назад',
  123 + s : 'несколько секунд',
  124 + h : 'час',
  125 + d : 'день',
  126 + M : 'месяц',
  127 + y : 'год'
  128 + },
  129 + ordinalParse: /\d{1,2}-(й|го|я)/,
  130 + ordinal: function (number, period) {
  131 + switch (period) {
  132 + case 'M':
  133 + case 'd':
  134 + case 'DDD':
  135 + return number + '-й';
  136 + case 'D':
  137 + return number + '-го';
  138 + case 'w':
  139 + case 'W':
  140 + return number + '-я';
  141 + default:
  142 + return number;
  143 + }
  144 + },
  145 + meridiemParse: /ночи|утра|дня|вечера/i,
  146 + isPM : function (input) {
  147 + return /^(дня|вечера)$/.test(input);
  148 + },
  149 + // in case the meridiem units are not separated around 12, then implement
  150 + // this function (look at locale/id.js for an example)
  151 + // meridiemHour : function (hour, meridiem) {
  152 + // return /* 0-23 hour, given meridiem token and hour 1-12 */
  153 + // },
  154 + },
  155 + meridiem : function (hour, minute, isLower) {
  156 + if (hour < 4) {
  157 + return 'ночи';
  158 + } else if (hour < 12) {
  159 + return 'утра';
  160 + } else if (hour < 17) {
  161 + return 'дня';
  162 + } else {
  163 + return 'вечера';
  164 + }
  165 + },
  166 + week : {
  167 + dow : 1, // Monday is the first day of the week.
  168 + doy : 7 // The week that contains Jan 1st is the first week of the year.
  169 + }
  170 + });
  171 + moment.locale('ru');
  172 + //Date range picker
  173 +
  174 +
  175 +
  176 +
  177 +
  178 +
  179 +
  180 + var result = [];
  181 + $(".order_lines").find(".order_line").each(function(){
  182 + result[result.length] = this;
  183 + });
  184 +
  185 +
  186 + var min_date = $(result[0]).find(".date").data('date');
  187 +
  188 + var conf = {startDate:moment(min_date, "DD.MM.YYYY"), format: 'DD.MM.YYYY',locale:
  189 + {
  190 + applyLabel: "<?= $t->_('apply')?>",
  191 + cancelLabel: "<?= $t->_('cancel')?>",
  192 + fromLabel: "<?= $t->_('from_month') ?>",
  193 + toLabel: "По",
  194 + weekLabel: 'Н'
  195 + }};
  196 + $('#reservation').daterangepicker(conf);
  197 + $('#DateReservation').daterangepicker(conf);
  198 +
  199 + $("body").on("click",".applyBtn",function(){
  200 +
  201 + var start = $("input[name=daterangepicker_start]").val();
  202 + var end = $("input[name=daterangepicker_end]").val();
  203 + var count = result.length;
  204 + var sum = 0;
  205 + var paid = 0;
  206 + for(var i=0; i<count; i++){
  207 + var date_val = $(result[i]).find(".date").data('date');
  208 + if(moment(date_val, 'DD.MM.YYYY' ) >= moment(start, 'DD.MM.YYYY' ) && moment(date_val, 'DD.MM.YYYY' ) <= moment(end, 'DD.MM.YYYY' ) ) {
  209 + $(result[i]).css("display","block");
  210 + sum += $(result[i]).find(".count").data("count") ? +$(result[i]).find(".count").data("count") : 0;
  211 +
  212 + paid += $(result[i]).find(".pay").data("pay") ? +$(result[i]).find(".pay").data("pay") : 0;
  213 +
  214 + } else {
  215 + $(result[i]).css("display","none");
  216 + }
  217 + }
  218 + $("#paid").html(paid.toFixed(1));
  219 + $("#sum").html(sum.toFixed(1));
  220 + $("#result").html((sum-paid).toFixed(1));
  221 + });
  222 + $('#DateReservation');
  223 +
  224 + $('.orders_data_request').click(function(){
  225 + var date_value = $('#reservation').val();
  226 + $("#DateReservation").val(date_value);
  227 + })
  228 +
  229 +</script>
62 \ No newline at end of file 230 \ No newline at end of file
src/app/frontend/views/index.php
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 <?= !empty( $meta_link_prev ) ? $meta_link_prev : '' ?> 8 <?= !empty( $meta_link_prev ) ? $meta_link_prev : '' ?>
9 <meta name="keywords" content="<?= !empty( $meta_keywords ) ? $meta_keywords : \config::get( 'global#title' ) ?>"> 9 <meta name="keywords" content="<?= !empty( $meta_keywords ) ? $meta_keywords : \config::get( 'global#title' ) ?>">
10 <meta name="description" content="<?= !empty( $meta_description ) ? $meta_description : \config::get( 'global#title' ) ?>"> 10 <meta name="description" content="<?= !empty( $meta_description ) ? $meta_description : \config::get( 'global#title' ) ?>">
  11 + <?php $this->assets->outputCss() ?>
11 <?php 12 <?php
12 if (!empty($lang)): 13 if (!empty($lang)):
13 if ($lang[count($lang)-1] == 'ru'): ?> 14 if ($lang[count($lang)-1] == 'ru'): ?>
@@ -102,12 +103,25 @@ $page_title = isset( $page_title ) &amp;&amp; !empty( $page_title ) ? $page_title : &#39;&#39;; @@ -102,12 +103,25 @@ $page_title = isset( $page_title ) &amp;&amp; !empty( $page_title ) ? $page_title : &#39;&#39;;
102 <a href="<?= $this->seoUrl->setUrl('/') ?>" title=""><img alt="Інтернет-магазин насіння" title="Магазин насіння Semena.in.ua" src="/images/logo.png" width="314" height="76" /></a> 103 <a href="<?= $this->seoUrl->setUrl('/') ?>" title=""><img alt="Інтернет-магазин насіння" title="Магазин насіння Semena.in.ua" src="/images/logo.png" width="314" height="76" /></a>
103 </div> 104 </div>
104 </div> 105 </div>
  106 +
  107 +
  108 +
  109 +
105 <div class="float columns3 third_column last"> 110 <div class="float columns3 third_column last">
106 <div class="clearfix"> 111 <div class="clearfix">
107 <div class="float basket_number float_right last"><a href="<?= $this->seoUrl->setUrl('/basket') ?>" title="<?= $t->_("cart")?>"><?= !empty( $in_cart ) ? count( $in_cart ) : '0' ?></a></div> 112 <div class="float basket_number float_right last"><a href="<?= $this->seoUrl->setUrl('/basket') ?>" title="<?= $t->_("cart")?>"><?= !empty( $in_cart ) ? count( $in_cart ) : '0' ?></a></div>
108 113
109 <div class="float basket float_right"><a href="<?= $this->seoUrl->setUrl('/basket') ?>" title="<?= $t->_("cart")?>" class="<?= (!empty( $static_page_alias ) && $static_page_alias == '/basket' ? ' active' : '') ?>"><?= $t->_("your_cart")?></a></div> 114 <div class="float basket float_right"><a href="<?= $this->seoUrl->setUrl('/basket') ?>" title="<?= $t->_("cart")?>" class="<?= (!empty( $static_page_alias ) && $static_page_alias == '/basket' ? ' active' : '') ?>"><?= $t->_("your_cart")?></a></div>
110 - <?= '<div class="float menu_cabinet float_right"><a href="'.$this->seoUrl->setUrl('/cabinet').'" title="'.(!empty( $customer['name'] ) ? $customer['name'] : $t->_("personal_account")).'" class="'.(!empty( $static_page_alias ) && $static_page_alias == '/cabinet' ? ' active' : '').'">'.(!empty( $customer['name'] ) ? $customer['name'] : $t->_("personal_account")).'</a></div>' ?> 115 + <?php echo '<div class="float menu_cabinet float_right">
  116 + <a href="'.$this->seoUrl->setUrl('/cabinet').'" title="'.(!empty( $customer['name'] ) ? $customer['name'] : $t->_("personal_account")).'" class="'.(!empty( $static_page_alias ) && $static_page_alias == '/cabinet' ? ' active' : '').'">'.(!empty( $customer['name'] ) ? $customer['name'] : $t->_("personal_account")).'</a>
  117 + </div>';
  118 +
  119 + if(!$this->getDi()->get('request')->get('_url') || $this->getDi()->get('request')->get('_url')=="/ru" ){?>
  120 + <div class="file_download_link_">
  121 + <a href="http://storage.semena.in.ua/temp/catalog.pdf"><?= $t->_("file_download_link")?></a>
  122 + </div>
  123 + <?php }?>
  124 +
111 </div> 125 </div>
112 126
113 <div class="clearfix compare_wrapper"> 127 <div class="clearfix compare_wrapper">
src/app/frontend/views/layouts/dealer.php
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 10
11 </head> 11 </head>
12 <body class="skin-blue sidebar-mini fixed"> 12 <body class="skin-blue sidebar-mini fixed">
  13 +
13 <?= $this->partial('partial/popupCart') ?> 14 <?= $this->partial('partial/popupCart') ?>
14 <div class="wrapper"> 15 <div class="wrapper">
15 16
@@ -22,6 +23,8 @@ @@ -22,6 +23,8 @@
22 23
23 </div><!-- ./wrapper --> 24 </div><!-- ./wrapper -->
24 25
  26 +
  27 +
25 <?= $this->partial('partial/footer', ['lang' => $lang]) ?> 28 <?= $this->partial('partial/footer', ['lang' => $lang]) ?>
26 29
27 </body> 30 </body>
src/app/frontend/views/partial/dealer.php
  1 +<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  2 + <div class="modal-dialog" role="document">
  3 + <div class="modal-content">
  4 + <div class="modal-header">
  5 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  6 + <h4 class="modal-title" id="myModalLabel"><?= $t->_('reconciliation') ?></h4>
  7 + </div>
  8 + <div class="modal-body">
  9 + <form id="callback_<?= ($lang_id == 1 ? 'ua' : 'ru') ?>" method="post" >
  10 + <div class="form-group">
  11 + <label for="DateReservation" class="sr-only">Дата</label>
  12 + <div class="input-group col-sm-10">
  13 + <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
  14 + <input placeholder="Дата" type="text" name="date" class="form-control" id="DateReservation">
  15 + </div>
  16 + </div>
  17 + <div class="form-group">
  18 + <label for="inputEmail3" class="sr-only">Email</label>
  19 + <div class="input-group col-sm-10">
  20 + <div class="input-group-addon">@</div>
  21 + <input type="email" name="email" value="<?= !empty( $customer['email'] ) ? $customer['email'] : '' ?>" class="form-control" id="inputEmail3" placeholder="Email">
  22 + </div>
  23 + </div>
  24 + <div class="form-group">
  25 + <label for="inputPhone" class="sr-only">Телефон</label>
  26 + <div class="input-group col-sm-10">
  27 + <div class="input-group-addon"><i class="fa fa-phone"></i></div>
  28 + <input type="text" name="phone" value="<?= !empty( $customer['phone'] ) ? $customer['phone'] : '' ?>" class="form-control" id="inputPhone" placeholder="Телефон">
  29 + </div>
  30 + </div>
  31 + <div class="form-group">
  32 + <label for="Name" class="sr-only"><?= $t->_('firstname') ?></label>
  33 + <div class="input-group col-sm-10">
  34 + <div class="input-group-addon"><i class="fa fa-user"></i></div>
  35 + <input type="text" name="name" value="<?= !empty( $customer['name'] ) ? $customer['name'] : '' ?>" class="form-control" id="Name" placeholder="<?= $t->_('firstname') ?>">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="sr-only" for="comment"><?= $t->_('comment_text') ?></label>
  40 + <div class="input-group col-sm-10">
  41 + <textarea placeholder="<?= $t->_('comment_text') ?>" name="comments" id="comment" class="form-control" cols="30" rows="5"></textarea>
  42 + </div>
  43 + </div>
  44 + <div class="form-group">
  45 + <button type="submit" class=" green_but"><?= $t->_('reconciliation') ?></button>
  46 + </div>
  47 + </form>
  48 + </div>
  49 + </div>
  50 + </div>
  51 +</div>
1 <header class="main-header"> 52 <header class="main-header">
2 <!-- Logo --> 53 <!-- Logo -->
3 <a href="/" class="logo"> 54 <a href="/" class="logo">
src/app/frontend/views/sendmail/message_9.phtml 0 → 100644
  1 +<?php
  2 +//p(\config::get( 'global#domains/www' ));
  3 +$lang_id = $this->seoUrl->getLangId();
  4 +$message_body_for_customer =
  5 + '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background: #ffffff; font-family:Arial; font-size:14px; color: #4a4a4a;">'.
  6 + '<tr>'.
  7 + '<td align="center" valign="top">'.
  8 + // HEADER STARTS
  9 + '<table width="600" cellspacing="0" cellpadding="0" border="0">'.
  10 + '<tr>'.
  11 + '<td height="76" width="143" valign="top" style="background: #ffffff;"></td>'.
  12 + '<td height="76" valign="top" style="background: #ffffff;">'.
  13 + '<a href="http://'.\config::get( 'global#domains/www' ).'" target="_blank"><img src="http://semena.in.ua/images/logo.png" width="314" height="76"></a>'.
  14 + '</td>'.
  15 + '<td height="76" width="143" valign="top" style="background: #ffffff;"></td>'.
  16 + '</tr>'.
  17 + '</table>'.
  18 + // HEADER END
  19 +
  20 + // CONTENT STARTS
  21 + '<table width="600" cellpadding="10" cellspacing="0" border="0" style="border-collapse: collapse; font-size:14px; margin:15px 0 0 0;">'.
  22 + '<tr>'.
  23 + '<td width="80%" >'.
  24 + '<p>Здравствуйте, админ</p>'.
  25 + '<p>'.
  26 + 'Клиент запросил сверку на сайте'."\n".
  27 + '</p>'.
  28 + '<p>'.
  29 + 'Номер заявки: '.$data['callback_id']."\n".
  30 + '</p>'.
  31 + '<p>'.
  32 + 'по датам: '.$data['date']."\n".
  33 + '</p>'.
  34 + '<p>'.
  35 + 'от: '.$data['name']."\n".
  36 + '</p>'.
  37 + '<p>'.
  38 + 'тел: '.( !empty( $data['phone'] ) ? $data['phone'] : 'Не указан' )."\n".
  39 + '</p>'.
  40 + '<p>'.
  41 + 'email: '.( !empty( $data['email'] ) ? $data['email'] : 'Не указан' )."\n".
  42 + '</p>'.
  43 + '<p>комментарии: '.$data['comments'].'</p>'.
  44 + '</td>'.
  45 + '</tr>'.
  46 + '</table>'.
  47 + '<br />'.
  48 +
  49 + // CONTENT END
  50 +
  51 + // FOOTER STARTS
  52 + '<table width="600" height="29" cellspacing="0" cellpadding="0" border="0">'.
  53 + '<tr>'.
  54 + '<td width="600"height="60" style="background: #4fa32c;">'.
  55 + '<p style="margin:10px 10px 0 10px; color:#ffffff; font-size:11px;">ТМ "ПРОФЕСІЙНЕ НАСІННЯ" та ТМ "ПРОФЕСІФНІ ДОБРИВА" - зареєстровані торгівельні марки. Усі права захищено.</p>'.
  56 + '</td>'.
  57 + '</tr>'.
  58 + '</table>'.
  59 + // FOOTER END
  60 + '</td>'.
  61 + '</tr>'.
  62 + '</table>';
  63 +
  64 +echo($message_body_for_customer);
0 \ No newline at end of file 65 \ No newline at end of file
src/lib/models.php
@@ -49,6 +49,7 @@ namespace @@ -49,6 +49,7 @@ namespace
49 protected $_sales = false; 49 protected $_sales = false;
50 protected $_reviews = false; 50 protected $_reviews = false;
51 protected $_modal = false; 51 protected $_modal = false;
  52 + protected $_manager_mail = false;
52 53
53 54
54 55
@@ -571,6 +572,17 @@ namespace @@ -571,6 +572,17 @@ namespace
571 572
572 return $this->_modal; 573 return $this->_modal;
573 } 574 }
  575 +
  576 + public function getManagerMail()
  577 + {
  578 + if( empty($this->_manager_mail) )
  579 + {
  580 + $this->_manager_mail = new \models\manager_mail();
  581 + $this->_manager_mail->setDi( $this->getDi() );
  582 + }
  583 +
  584 + return $this->_manager_mail;
  585 + }
574 } 586 }
575 } 587 }
576 588
src/lib/models/manager_mail.php 0 → 100644
  1 +<?php
  2 +
  3 +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4 +
  5 +namespace models;
  6 +
  7 +class manager_mail extends \db
  8 +{
  9 +
  10 + public function addData($data) {
  11 + return $this->get(
  12 + '
  13 + INSERT INTO
  14 + public.manager_mail
  15 + (
  16 + "text"
  17 + )
  18 + VALUES
  19 + (
  20 + :text
  21 + )
  22 + RETURNING manager_mail_id
  23 + ',
  24 + [
  25 + 'text' => $data['text']
  26 + ],
  27 + -1
  28 + );
  29 + }
  30 + public function getData()
  31 + {
  32 +
  33 + return $this->get(
  34 + '
  35 + SELECT
  36 + *
  37 + FROM
  38 + public.manager_mail
  39 + where manager_mail_id =1
  40 + ',
  41 + [],
  42 + -1
  43 +
  44 + );
  45 + }
  46 +
  47 +
  48 + public function UpdateData($data)
  49 + {
  50 + return $this->exec(
  51 + '
  52 + UPDATE
  53 + public.manager_mail
  54 + SET
  55 + text = :text
  56 + where manager_mail_id = 1
  57 + ',
  58 + [
  59 + "text" => $data['text'],
  60 + ]
  61 + );
  62 + }
  63 +
  64 +
  65 +
  66 +}
0 \ No newline at end of file 67 \ No newline at end of file
src/lib/sendmail.php
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 4
5 namespace 5 namespace
6 { 6 {
  7 + require( __DIR__.'/PHPMaile/PHPMailerAutoload.php');
7 /** 8 /**
8 * sendmail 9 * sendmail
9 * 10 *
@@ -24,7 +25,7 @@ namespace @@ -24,7 +25,7 @@ namespace
24 * @param array $data 25 * @param array $data
25 * @return string 26 * @return string
26 */ 27 */
27 - public function addCustomer( $type, $data ) 28 + public function addCustomer( $type, $data, $info = '' )
28 { 29 {
29 $view = new \Phalcon\Mvc\View(); 30 $view = new \Phalcon\Mvc\View();
30 $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) ); 31 $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) );
@@ -35,6 +36,11 @@ namespace @@ -35,6 +36,11 @@ namespace
35 $view->render( 'sendmail', 'message_'.$type ); 36 $view->render( 'sendmail', 'message_'.$type );
36 37
37 $view->finish(); 38 $view->finish();
  39 + //p($data_base['message_body'],1);
  40 +
  41 + //$email_to_customer = $data['email'];
  42 + $email_from = 'Robot <robot@'.\config::get( 'global#domains/www' ).'>';
  43 + //$email_reply_customer = $data['name'].' <'.$data['email'].'>';
38 44
39 switch( $type ) 45 switch( $type )
40 { 46 {
@@ -117,18 +123,25 @@ namespace @@ -117,18 +123,25 @@ namespace
117 'message_body' => $view->getContent() 123 'message_body' => $view->getContent()
118 ]; 124 ];
119 break; 125 break;
120 - 126 + case 9: //callback email for admin
  127 +
  128 + $data_base =
  129 + [
  130 +
  131 + 'email_to' => $info[0]['text'],
  132 + 'email_reply' => $data['name'].' <'.$data['email'].'>',
  133 + 'subject' => 'Ваше сообщение на сайте: '.\config::get( 'global#title' ),
  134 + 'message_body' => $view->getContent()
  135 + ];
  136 +
  137 + break;
121 138
122 default: 139 default:
123 return false; 140 return false;
124 break; 141 break;
125 } 142 }
126 143
127 - //p($data_base['message_body'],1);  
128 144
129 - //$email_to_customer = $data['email'];  
130 - $email_from = 'Robot <robot@'.\config::get( 'global#domains/www' ).'>';  
131 - //$email_reply_customer = $data['name'].' <'.$data['email'].'>';  
132 145
133 146
134 $header = 147 $header =
www-backend/index.php
@@ -1611,7 +1611,15 @@ try @@ -1611,7 +1611,15 @@ try
1611 ] 1611 ]
1612 ) 1612 )
1613 ->setName( 'set_pdf_file' ); 1613 ->setName( 'set_pdf_file' );
1614 - 1614 + $router->add
  1615 + (
  1616 + '/set_reconciliation',
  1617 + [
  1618 + 'controller' => 'seo',
  1619 + 'action' => 'setReconciliation',
  1620 + ]
  1621 + )
  1622 + ->setName( 'set_reconciliation' );
1615 /////////////////////////////////////////////////////////////////////////////////////////////////////// 1623 ///////////////////////////////////////////////////////////////////////////////////////////////////////
1616 1624
1617 1625
www/css/dealers.css
@@ -1569,4 +1569,56 @@ section .items .one_item { @@ -1569,4 +1569,56 @@ section .items .one_item {
1569 .order_line:last-child .fin_cell.money{border-bottom:none!important; padding-bottom:15px!important;} 1569 .order_line:last-child .fin_cell.money{border-bottom:none!important; padding-bottom:15px!important;}
1570 .line.l_one{height: 45px;overflow: hidden;} 1570 .line.l_one{height: 45px;overflow: hidden;}
1571 .lines_final{float: left;margin-top: -1px;} 1571 .lines_final{float: left;margin-top: -1px;}
1572 -.text  
1573 \ No newline at end of file 1572 \ No newline at end of file
  1573 +
  1574 +.daterangepicker .ranges{
  1575 + width:190px;
  1576 +}
  1577 +.daterangepicker .calendar{
  1578 + max-width: 305px;
  1579 +}
  1580 +.custom_width{
  1581 + width: 200px !important;
  1582 +}
  1583 +
  1584 +.orders_data_request{
  1585 + box-sizing: border-box;
  1586 + color: #ffffff;
  1587 + text-transform: uppercase;
  1588 + text-decoration: none;
  1589 + background-color: #67b73e;
  1590 + border: 3px solid #67b73e;
  1591 + border-bottom-color: #55a727;
  1592 + font-size: 14px;
  1593 + font-weight: bold;
  1594 + border-radius: 3px;
  1595 + padding-top: 8px;
  1596 + padding-bottom: 8px;
  1597 + width: 171px;
  1598 + display: block;
  1599 + text-align: center;
  1600 + margin-top: 7px;
  1601 + margin-left: 540px;
  1602 +}
  1603 +
  1604 +.applyBtn{
  1605 + background-color: #67b73e;
  1606 + border: 3px solid #67b73e;
  1607 + border-bottom-color: #55a727;
  1608 + font-size: 10px;
  1609 + border-radius: 3px;
  1610 + padding-top: 5px;
  1611 + padding-bottom: 5px;
  1612 + width: auto;
  1613 +}
  1614 +
  1615 +
  1616 +.cancelBtn{
  1617 + color: #333;
  1618 + background-color: #fff;
  1619 + border: 1px solid black;
  1620 + font-size: 10px;
  1621 + border-radius: 3px;
  1622 + padding-top: 7px;
  1623 + padding-bottom: 7px;
  1624 + width: auto;
  1625 +}
1574 \ No newline at end of file 1626 \ No newline at end of file
@@ -3818,4 +3818,16 @@ input[type=number]::-webkit-outer-spin-button { @@ -3818,4 +3818,16 @@ input[type=number]::-webkit-outer-spin-button {
3818 } 3818 }
3819 input[type=number] { 3819 input[type=number] {
3820 -moz-appearance: textfield; 3820 -moz-appearance: textfield;
3821 -}  
3822 \ No newline at end of file 3821 \ No newline at end of file
  3822 +}
  3823 +
  3824 +.file_download_link_ {position:relative}
  3825 +.file_download_link_ a {
  3826 + position: absolute;
  3827 + top: 32px;
  3828 + left: 0;
  3829 + padding: 10px 10px 10px 22px;
  3830 + background: url(../images/icon_catalog_18x18_01.png) no-repeat 0 50%;
  3831 + margin-left: 23px;
  3832 + z-index: 3;
  3833 +}
  3834 +
www/images/icon_catalog_18x18_01.png 0 → 100644

283 Bytes

@@ -789,7 +789,15 @@ try @@ -789,7 +789,15 @@ try
789 ] 789 ]
790 ) 790 )
791 ->setName( 'callback' ); 791 ->setName( 'callback' );
792 - 792 + $router->add
  793 + (
  794 + '/count{language:([/][a-z]{2})?}',
  795 + [
  796 + 'controller' => 'menu',
  797 + 'action' => 'count',
  798 + ]
  799 + )
  800 + ->setName( 'count' );
793 $router->add 801 $router->add
794 ( 802 (
795 '/call-back{language:([/][a-z]{2})?}', // callbackErrors 803 '/call-back{language:([/][a-z]{2})?}', // callbackErrors
@@ -1795,7 +1803,11 @@ try @@ -1795,7 +1803,11 @@ try
1795 { 1803 {
1796 return new \exelphp(); 1804 return new \exelphp();
1797 }, true ); 1805 }, true );
1798 - 1806 + $di->set( 'assets', function()
  1807 + {
  1808 + return new Phalcon\Assets\Manager();
  1809 + }, true );
  1810 +
1799 /////////////////////////////////////////////////////////////////////////// 1811 ///////////////////////////////////////////////////////////////////////////
1800 1812
1801 // database 1813 // database
@@ -1970,6 +1970,18 @@ $(&#39;.group_sizes:first&#39;).click(); @@ -1970,6 +1970,18 @@ $(&#39;.group_sizes:first&#39;).click();
1970 minScale: 1 1970 minScale: 1
1971 }); 1971 });
1972 1972
  1973 + $('#ajax_simple').iLightBox({
  1974 + attr: 'target',
  1975 + innerToolbar: true,
  1976 + overlay: {
  1977 + opacity: .6
  1978 + },
  1979 + controls: {
  1980 + fullscreen: false
  1981 + },
  1982 + skin: 'light',
  1983 + minScale: 1
  1984 + });
1973 1985
1974 1986
1975 /////////////////////////////////////////////////////////////////////// 1987 ///////////////////////////////////////////////////////////////////////
www/plugins/daterangepicker/daterangepicker.js
1 /** 1 /**
2 -* @version: 1.3.21  
3 -* @author: Dan Grossman http://www.dangrossman.info/  
4 -* @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.  
5 -* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php  
6 -* @website: https://www.improvely.com/  
7 -*/ 2 + * @version: 1.3.21
  3 + * @author: Dan Grossman http://www.dangrossman.info/
  4 + * @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
  5 + * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
  6 + * @website: https://www.improvely.com/
  7 + */
8 8
9 (function(root, factory) { 9 (function(root, factory) {
10 10
11 - if (typeof define === 'function' && define.amd) {  
12 - define(['moment', 'jquery', 'exports'], function(momentjs, $, exports) {  
13 - root.daterangepicker = factory(root, exports, momentjs, $);  
14 - });  
15 -  
16 - } else if (typeof exports !== 'undefined') {  
17 - var momentjs = require('moment');  
18 - var jQuery;  
19 - try {  
20 - jQuery = require('jquery');  
21 - } catch (err) {  
22 - jQuery = window.jQuery;  
23 - if (!jQuery) throw new Error('jQuery dependency not found');  
24 - } 11 + if (typeof define === 'function' && define.amd) {
  12 + define(['moment', 'jquery', 'exports'], function(momentjs, $, exports) {
  13 + root.daterangepicker = factory(root, exports, momentjs, $);
  14 + });
  15 +
  16 + } else if (typeof exports !== 'undefined') {
  17 + var momentjs = require('moment');
  18 + var jQuery;
  19 + try {
  20 + jQuery = require('jquery');
  21 + } catch (err) {
  22 + jQuery = window.jQuery;
  23 + if (!jQuery) throw new Error('jQuery dependency not found');
  24 + }
25 25
26 - factory(root, exports, momentjs, jQuery); 26 + factory(root, exports, momentjs, jQuery);
27 27
28 - // Finally, as a browser global.  
29 - } else {  
30 - root.daterangepicker = factory(root, {}, root.moment, (root.jQuery || root.Zepto || root.ender || root.$));  
31 - } 28 + // Finally, as a browser global.
  29 + } else {
  30 + root.daterangepicker = factory(root, {}, root.moment, (root.jQuery || root.Zepto || root.ender || root.$));
  31 + }
32 32
33 }(this, function(root, daterangepicker, moment, $) { 33 }(this, function(root, daterangepicker, moment, $) {
34 34
@@ -45,23 +45,23 @@ @@ -45,23 +45,23 @@
45 45
46 //create the picker HTML object 46 //create the picker HTML object
47 var DRPTemplate = '<div class="daterangepicker dropdown-menu">' + 47 var DRPTemplate = '<div class="daterangepicker dropdown-menu">' +
48 - '<div class="calendar first left"></div>' +  
49 - '<div class="calendar second right"></div>' +  
50 - '<div class="ranges">' +  
51 - '<div class="range_inputs">' +  
52 - '<div class="daterangepicker_start_input">' +  
53 - '<label for="daterangepicker_start"></label>' +  
54 - '<input class="input-mini" type="text" name="daterangepicker_start" value="" />' +  
55 - '</div>' +  
56 - '<div class="daterangepicker_end_input">' +  
57 - '<label for="daterangepicker_end"></label>' +  
58 - '<input class="input-mini" type="text" name="daterangepicker_end" value="" />' +  
59 - '</div>' +  
60 - '<button class="applyBtn" disabled="disabled"></button>&nbsp;' +  
61 - '<button class="cancelBtn"></button>' +  
62 - '</div>' +  
63 - '</div>' +  
64 - '</div>'; 48 + '<div class="calendar first left"></div>' +
  49 + '<div class="calendar second right"></div>' +
  50 + '<div class="ranges">' +
  51 + '<div class="range_inputs">' +
  52 + '<div class="daterangepicker_start_input">' +
  53 + '<label for="daterangepicker_start"></label>' +
  54 + '<input class="input-mini" type="text" name="daterangepicker_start" value="" />' +
  55 + '</div>' +
  56 + '<div class="daterangepicker_end_input">' +
  57 + '<label for="daterangepicker_end"></label>' +
  58 + '<input class="input-mini" type="text" name="daterangepicker_end" value="" />' +
  59 + '</div>' +
  60 + '<button class="applyBtn" disabled="disabled"></button>&nbsp;' +
  61 + '<button class="cancelBtn"></button>' +
  62 + '</div>' +
  63 + '</div>' +
  64 + '</div>';
65 65
66 //custom options 66 //custom options
67 if (typeof options !== 'object' || options === null) 67 if (typeof options !== 'object' || options === null)
@@ -205,35 +205,35 @@ @@ -205,35 +205,35 @@
205 } 205 }
206 206
207 if (typeof options.locale.monthNames === 'object') { 207 if (typeof options.locale.monthNames === 'object') {
208 - this.locale.monthNames = options.locale.monthNames.slice(); 208 + this.locale.monthNames = options.locale.monthNames.slice();
209 } 209 }
210 210
211 if (typeof options.locale.firstDay === 'number') { 211 if (typeof options.locale.firstDay === 'number') {
212 - this.locale.firstDay = options.locale.firstDay; 212 + this.locale.firstDay = options.locale.firstDay;
213 } 213 }
214 214
215 if (typeof options.locale.applyLabel === 'string') { 215 if (typeof options.locale.applyLabel === 'string') {
216 - this.locale.applyLabel = options.locale.applyLabel; 216 + this.locale.applyLabel = options.locale.applyLabel;
217 } 217 }
218 218
219 if (typeof options.locale.cancelLabel === 'string') { 219 if (typeof options.locale.cancelLabel === 'string') {
220 - this.locale.cancelLabel = options.locale.cancelLabel; 220 + this.locale.cancelLabel = options.locale.cancelLabel;
221 } 221 }
222 222
223 if (typeof options.locale.fromLabel === 'string') { 223 if (typeof options.locale.fromLabel === 'string') {
224 - this.locale.fromLabel = options.locale.fromLabel; 224 + this.locale.fromLabel = options.locale.fromLabel;
225 } 225 }
226 226
227 if (typeof options.locale.toLabel === 'string') { 227 if (typeof options.locale.toLabel === 'string') {
228 - this.locale.toLabel = options.locale.toLabel; 228 + this.locale.toLabel = options.locale.toLabel;
229 } 229 }
230 230
231 if (typeof options.locale.weekLabel === 'string') { 231 if (typeof options.locale.weekLabel === 'string') {
232 - this.locale.weekLabel = options.locale.weekLabel; 232 + this.locale.weekLabel = options.locale.weekLabel;
233 } 233 }
234 234
235 if (typeof options.locale.customRangeLabel === 'string') { 235 if (typeof options.locale.customRangeLabel === 'string') {
236 - this.locale.customRangeLabel = options.locale.customRangeLabel; 236 + this.locale.customRangeLabel = options.locale.customRangeLabel;
237 } 237 }
238 } 238 }
239 239
@@ -317,13 +317,13 @@ @@ -317,13 +317,13 @@
317 317
318 // bind the time zone used to build the calendar to either the timeZone passed in through the options or the zone of the startDate (which will be the local time zone by default) 318 // bind the time zone used to build the calendar to either the timeZone passed in through the options or the zone of the startDate (which will be the local time zone by default)
319 if (typeof options.timeZone === 'string' || typeof options.timeZone === 'number') { 319 if (typeof options.timeZone === 'string' || typeof options.timeZone === 'number') {
320 - if (typeof options.timeZone === 'string' && typeof moment.tz !== 'undefined') {  
321 - this.timeZone = moment.tz.zone(options.timeZone).parse(new Date) * -1; // Offset is positive if the timezone is behind UTC and negative if it is ahead.  
322 - } else {  
323 - this.timeZone = options.timeZone;  
324 - }  
325 - this.startDate.utcOffset(this.timeZone);  
326 - this.endDate.utcOffset(this.timeZone); 320 + if (typeof options.timeZone === 'string' && typeof moment.tz !== 'undefined') {
  321 + this.timeZone = moment.tz.zone(options.timeZone).parse(new Date) * -1; // Offset is positive if the timezone is behind UTC and negative if it is ahead.
  322 + } else {
  323 + this.timeZone = options.timeZone;
  324 + }
  325 + this.startDate.utcOffset(this.timeZone);
  326 + this.endDate.utcOffset(this.timeZone);
327 } else { 327 } else {
328 this.timeZone = moment(this.startDate).utcOffset(); 328 this.timeZone = moment(this.startDate).utcOffset();
329 } 329 }
@@ -536,12 +536,12 @@ @@ -536,12 +536,12 @@
536 536
537 this.updateCalendars(); 537 this.updateCalendars();
538 }, 538 },
539 - 539 +
540 keydown: function (e) { 540 keydown: function (e) {
541 //hide on tab or enter 541 //hide on tab or enter
542 - if ((e.keyCode === 9) || (e.keyCode === 13)) {  
543 - this.hide();  
544 - } 542 + if ((e.keyCode === 9) || (e.keyCode === 13)) {
  543 + this.hide();
  544 + }
545 }, 545 },
546 546
547 notify: function () { 547 notify: function () {
@@ -551,7 +551,7 @@ @@ -551,7 +551,7 @@
551 551
552 move: function () { 552 move: function () {
553 var parentOffset = { top: 0, left: 0 }, 553 var parentOffset = { top: 0, left: 0 },
554 - containerTop; 554 + containerTop;
555 var parentRightEdge = $(window).width(); 555 var parentRightEdge = $(window).width();
556 if (!this.parentEl.is('body')) { 556 if (!this.parentEl.is('body')) {
557 parentOffset = { 557 parentOffset = {
@@ -560,11 +560,11 @@ @@ -560,11 +560,11 @@
560 }; 560 };
561 parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left; 561 parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
562 } 562 }
563 - 563 +
564 if (this.drops == 'up') 564 if (this.drops == 'up')
565 - containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; 565 + containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
566 else 566 else
567 - containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; 567 + containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
568 this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup'); 568 this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup');
569 569
570 if (this.opens == 'left') { 570 if (this.opens == 'left') {
@@ -583,7 +583,7 @@ @@ -583,7 +583,7 @@
583 this.container.css({ 583 this.container.css({
584 top: containerTop, 584 top: containerTop,
585 left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2 585 left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
586 - - this.container.outerWidth() / 2, 586 + - this.container.outerWidth() / 2,
587 right: 'auto' 587 right: 'auto'
588 }); 588 });
589 if (this.container.offset().left < 0) { 589 if (this.container.offset().left < 0) {
@@ -626,13 +626,13 @@ @@ -626,13 +626,13 @@
626 this._outsideClickProxy = $.proxy(function (e) { this.outsideClick(e); }, this); 626 this._outsideClickProxy = $.proxy(function (e) { this.outsideClick(e); }, this);
627 // Bind global datepicker mousedown for hiding and 627 // Bind global datepicker mousedown for hiding and
628 $(document) 628 $(document)
629 - .on('mousedown.daterangepicker', this._outsideClickProxy)  
630 - // also support mobile devices  
631 - .on('touchend.daterangepicker', this._outsideClickProxy)  
632 - // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them  
633 - .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)  
634 - // and also close when focus changes to outside the picker (eg. tabbing between controls)  
635 - .on('focusin.daterangepicker', this._outsideClickProxy); 629 + .on('mousedown.daterangepicker', this._outsideClickProxy)
  630 + // also support mobile devices
  631 + .on('touchend.daterangepicker', this._outsideClickProxy)
  632 + // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
  633 + .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
  634 + // and also close when focus changes to outside the picker (eg. tabbing between controls)
  635 + .on('focusin.daterangepicker', this._outsideClickProxy);
636 636
637 this.isShowing = true; 637 this.isShowing = true;
638 this.element.trigger('show.daterangepicker', this); 638 this.element.trigger('show.daterangepicker', this);
@@ -644,11 +644,11 @@ @@ -644,11 +644,11 @@
644 // itself then call this.hide() 644 // itself then call this.hide()
645 if ( 645 if (
646 // ie modal dialog fix 646 // ie modal dialog fix
647 - e.type == "focusin" ||  
648 - target.closest(this.element).length ||  
649 - target.closest(this.container).length ||  
650 - target.closest('.calendar-date').length  
651 - ) return; 647 + e.type == "focusin" ||
  648 + target.closest(this.element).length ||
  649 + target.closest(this.container).length ||
  650 + target.closest('.calendar-date').length
  651 + ) return;
652 this.hide(); 652 this.hide();
653 }, 653 },
654 654
@@ -656,7 +656,7 @@ @@ -656,7 +656,7 @@
656 if (!this.isShowing) return; 656 if (!this.isShowing) return;
657 657
658 $(document) 658 $(document)
659 - .off('.daterangepicker'); 659 + .off('.daterangepicker');
660 660
661 this.element.removeClass('active'); 661 this.element.removeClass('active');
662 this.container.hide(); 662 this.container.hide();
@@ -795,7 +795,7 @@ @@ -795,7 +795,7 @@
795 var difference = this.endDate.diff(this.startDate); 795 var difference = this.endDate.diff(this.startDate);
796 endDate = moment(startDate).add(difference, 'ms'); 796 endDate = moment(startDate).add(difference, 'ms');
797 if (this.maxDate && endDate.isAfter(this.maxDate)) { 797 if (this.maxDate && endDate.isAfter(this.maxDate)) {
798 - endDate = this.maxDate.clone(); 798 + endDate = this.maxDate.clone();
799 } 799 }
800 } 800 }
801 this.startDate = startDate; 801 this.startDate = startDate;
www/plugins/daterangepicker/moment.js
@@ -6,12 +6,12 @@ @@ -6,12 +6,12 @@
6 6
7 (function (undefined) { 7 (function (undefined) {
8 /************************************ 8 /************************************
9 - Constants  
10 - ************************************/ 9 + Constants
  10 + ************************************/
11 11
12 var moment, 12 var moment,
13 VERSION = '2.9.0', 13 VERSION = '2.9.0',
14 - // the global-scope this is NOT the global object in Node.js 14 + // the global-scope this is NOT the global object in Node.js
15 globalScope = (typeof global !== 'undefined' && (typeof window === 'undefined' || window === global.window)) ? global : this, 15 globalScope = (typeof global !== 'undefined' && (typeof window === 'undefined' || window === global.window)) ? global : this,
16 oldGlobalMoment, 16 oldGlobalMoment,
17 round = Math.round, 17 round = Math.round,
@@ -26,28 +26,28 @@ @@ -26,28 +26,28 @@
26 SECOND = 5, 26 SECOND = 5,
27 MILLISECOND = 6, 27 MILLISECOND = 6,
28 28
29 - // internal storage for locale config files 29 + // internal storage for locale config files
30 locales = {}, 30 locales = {},
31 31
32 - // extra moment internal properties (plugins register props here) 32 + // extra moment internal properties (plugins register props here)
33 momentProperties = [], 33 momentProperties = [],
34 34
35 - // check for nodeJS 35 + // check for nodeJS
36 hasModule = (typeof module !== 'undefined' && module && module.exports), 36 hasModule = (typeof module !== 'undefined' && module && module.exports),
37 37
38 - // ASP.NET json date format regex 38 + // ASP.NET json date format regex
39 aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, 39 aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
40 aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, 40 aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,
41 41
42 - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html  
43 - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere 42 + // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  43 + // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
44 isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, 44 isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,
45 45
46 - // format tokens 46 + // format tokens
47 formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g, 47 formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,
48 localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, 48 localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
49 49
50 - // parsing token regexes 50 + // parsing token regexes
51 parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 51 parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99
52 parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 52 parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999
53 parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 53 parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 parseTokenOffsetMs = /[\+\-]?\d+/, // 1234567890123 59 parseTokenOffsetMs = /[\+\-]?\d+/, // 1234567890123
60 parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 60 parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
61 61
62 - //strict parsing regexes 62 + //strict parsing regexes
63 parseTokenOneDigit = /\d/, // 0 - 9 63 parseTokenOneDigit = /\d/, // 0 - 9
64 parseTokenTwoDigits = /\d\d/, // 00 - 99 64 parseTokenTwoDigits = /\d\d/, // 00 - 99
65 parseTokenThreeDigits = /\d{3}/, // 000 - 999 65 parseTokenThreeDigits = /\d{3}/, // 000 - 999
@@ -67,8 +67,8 @@ @@ -67,8 +67,8 @@
67 parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 67 parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999
68 parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf 68 parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf
69 69
70 - // iso 8601 regex  
71 - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) 70 + // iso 8601 regex
  71 + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
72 isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, 72 isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
73 73
74 isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', 74 isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 ['YYYY-DDD', /\d{4}-\d{3}/] 81 ['YYYY-DDD', /\d{4}-\d{3}/]
82 ], 82 ],
83 83
84 - // iso time formats and regexes 84 + // iso time formats and regexes
85 isoTimes = [ 85 isoTimes = [
86 ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], 86 ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/],
87 ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], 87 ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
@@ -89,10 +89,10 @@ @@ -89,10 +89,10 @@
89 ['HH', /(T| )\d\d/] 89 ['HH', /(T| )\d\d/]
90 ], 90 ],
91 91
92 - // timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-', '15', '30'] 92 + // timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-', '15', '30']
93 parseTimezoneChunker = /([\+\-]|\d\d)/gi, 93 parseTimezoneChunker = /([\+\-]|\d\d)/gi,
94 94
95 - // getter and setter names 95 + // getter and setter names
96 proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), 96 proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
97 unitMillisecondFactors = { 97 unitMillisecondFactors = {
98 'Milliseconds' : 1, 98 'Milliseconds' : 1,
@@ -131,10 +131,10 @@ @@ -131,10 +131,10 @@
131 isoweekyear : 'isoWeekYear' 131 isoweekyear : 'isoWeekYear'
132 }, 132 },
133 133
134 - // format function strings 134 + // format function strings
135 formatFunctions = {}, 135 formatFunctions = {},
136 136
137 - // default relative time thresholds 137 + // default relative time thresholds
138 relativeTimeThresholds = { 138 relativeTimeThresholds = {
139 s: 45, // seconds to minute 139 s: 45, // seconds to minute
140 m: 45, // minutes to hour 140 m: 45, // minutes to hour
@@ -143,7 +143,7 @@ @@ -143,7 +143,7 @@
143 M: 11 // months to year 143 M: 11 // months to year
144 }, 144 },
145 145
146 - // tokens to ordinalize and pad 146 + // tokens to ordinalize and pad
147 ordinalizeTokens = 'DDD w W M D d'.split(' '), 147 ordinalizeTokens = 'DDD w W M D d'.split(' '),
148 paddedTokens = 'M D H h m s w W'.split(' '), 148 paddedTokens = 'M D H h m s w W'.split(' '),
149 149
@@ -322,7 +322,7 @@ @@ -322,7 +322,7 @@
322 322
323 function printMsg(msg) { 323 function printMsg(msg) {
324 if (moment.suppressDeprecationWarnings === false && 324 if (moment.suppressDeprecationWarnings === false &&
325 - typeof console !== 'undefined' && console.warn) { 325 + typeof console !== 'undefined' && console.warn) {
326 console.warn('Deprecation warning: ' + msg); 326 console.warn('Deprecation warning: ' + msg);
327 } 327 }
328 } 328 }
@@ -359,7 +359,7 @@ @@ -359,7 +359,7 @@
359 function monthDiff(a, b) { 359 function monthDiff(a, b) {
360 // difference in months 360 // difference in months
361 var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), 361 var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
362 - // b is in (anchor - 1 month, anchor + 1 month) 362 + // b is in (anchor - 1 month, anchor + 1 month)
363 anchor = a.clone().add(wholeMonthDiff, 'months'), 363 anchor = a.clone().add(wholeMonthDiff, 'months'),
364 anchor2, adjust; 364 anchor2, adjust;
365 365
@@ -413,8 +413,8 @@ @@ -413,8 +413,8 @@
413 } 413 }
414 414
415 /************************************ 415 /************************************
416 - Constructors  
417 - ************************************/ 416 + Constructors
  417 + ************************************/
418 418
419 function Locale() { 419 function Locale() {
420 } 420 }
@@ -472,8 +472,8 @@ @@ -472,8 +472,8 @@
472 } 472 }
473 473
474 /************************************ 474 /************************************
475 - Helpers  
476 - ************************************/ 475 + Helpers
  476 + ************************************/
477 477
478 478
479 function extend(a, b) { 479 function extend(a, b) {
@@ -754,15 +754,15 @@ @@ -754,15 +754,15 @@
754 if (m._a && m._pf.overflow === -2) { 754 if (m._a && m._pf.overflow === -2) {
755 overflow = 755 overflow =
756 m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : 756 m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH :
757 - m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE :  
758 - m._a[HOUR] < 0 || m._a[HOUR] > 24 ||  
759 - (m._a[HOUR] === 24 && (m._a[MINUTE] !== 0 ||  
760 - m._a[SECOND] !== 0 ||  
761 - m._a[MILLISECOND] !== 0)) ? HOUR :  
762 - m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE :  
763 - m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND :  
764 - m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND :  
765 - -1; 757 + m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE :
  758 + m._a[HOUR] < 0 || m._a[HOUR] > 24 ||
  759 + (m._a[HOUR] === 24 && (m._a[MINUTE] !== 0 ||
  760 + m._a[SECOND] !== 0 ||
  761 + m._a[MILLISECOND] !== 0)) ? HOUR :
  762 + m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE :
  763 + m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND :
  764 + m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND :
  765 + -1;
766 766
767 if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { 767 if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
768 overflow = DATE; 768 overflow = DATE;
@@ -854,8 +854,8 @@ @@ -854,8 +854,8 @@
854 } 854 }
855 855
856 /************************************ 856 /************************************
857 - Locale  
858 - ************************************/ 857 + Locale
  858 + ************************************/
859 859
860 860
861 extend(Locale.prototype, { 861 extend(Locale.prototype, {
@@ -1066,8 +1066,8 @@ @@ -1066,8 +1066,8 @@
1066 }); 1066 });
1067 1067
1068 /************************************ 1068 /************************************
1069 - Formatting  
1070 - ************************************/ 1069 + Formatting
  1070 + ************************************/
1071 1071
1072 1072
1073 function removeFormattingTokens(input) { 1073 function removeFormattingTokens(input) {
@@ -1131,97 +1131,97 @@ @@ -1131,97 +1131,97 @@
1131 1131
1132 1132
1133 /************************************ 1133 /************************************
1134 - Parsing  
1135 - ************************************/ 1134 + Parsing
  1135 + ************************************/
1136 1136
1137 1137
1138 // get the regex to find the next token 1138 // get the regex to find the next token
1139 function getParseRegexForToken(token, config) { 1139 function getParseRegexForToken(token, config) {
1140 var a, strict = config._strict; 1140 var a, strict = config._strict;
1141 switch (token) { 1141 switch (token) {
1142 - case 'Q':  
1143 - return parseTokenOneDigit;  
1144 - case 'DDDD':  
1145 - return parseTokenThreeDigits;  
1146 - case 'YYYY':  
1147 - case 'GGGG':  
1148 - case 'gggg':  
1149 - return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;  
1150 - case 'Y':  
1151 - case 'G':  
1152 - case 'g':  
1153 - return parseTokenSignedNumber;  
1154 - case 'YYYYYY':  
1155 - case 'YYYYY':  
1156 - case 'GGGGG':  
1157 - case 'ggggg':  
1158 - return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;  
1159 - case 'S':  
1160 - if (strict) { 1142 + case 'Q':
1161 return parseTokenOneDigit; 1143 return parseTokenOneDigit;
1162 - } 1144 + case 'DDDD':
  1145 + return parseTokenThreeDigits;
  1146 + case 'YYYY':
  1147 + case 'GGGG':
  1148 + case 'gggg':
  1149 + return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;
  1150 + case 'Y':
  1151 + case 'G':
  1152 + case 'g':
  1153 + return parseTokenSignedNumber;
  1154 + case 'YYYYYY':
  1155 + case 'YYYYY':
  1156 + case 'GGGGG':
  1157 + case 'ggggg':
  1158 + return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;
  1159 + case 'S':
  1160 + if (strict) {
  1161 + return parseTokenOneDigit;
  1162 + }
1163 /* falls through */ 1163 /* falls through */
1164 - case 'SS':  
1165 - if (strict) {  
1166 - return parseTokenTwoDigits;  
1167 - } 1164 + case 'SS':
  1165 + if (strict) {
  1166 + return parseTokenTwoDigits;
  1167 + }
1168 /* falls through */ 1168 /* falls through */
1169 - case 'SSS':  
1170 - if (strict) {  
1171 - return parseTokenThreeDigits;  
1172 - } 1169 + case 'SSS':
  1170 + if (strict) {
  1171 + return parseTokenThreeDigits;
  1172 + }
1173 /* falls through */ 1173 /* falls through */
1174 - case 'DDD':  
1175 - return parseTokenOneToThreeDigits;  
1176 - case 'MMM':  
1177 - case 'MMMM':  
1178 - case 'dd':  
1179 - case 'ddd':  
1180 - case 'dddd':  
1181 - return parseTokenWord;  
1182 - case 'a':  
1183 - case 'A':  
1184 - return config._locale._meridiemParse;  
1185 - case 'x':  
1186 - return parseTokenOffsetMs;  
1187 - case 'X':  
1188 - return parseTokenTimestampMs;  
1189 - case 'Z':  
1190 - case 'ZZ':  
1191 - return parseTokenTimezone;  
1192 - case 'T':  
1193 - return parseTokenT;  
1194 - case 'SSSS':  
1195 - return parseTokenDigits;  
1196 - case 'MM':  
1197 - case 'DD':  
1198 - case 'YY':  
1199 - case 'GG':  
1200 - case 'gg':  
1201 - case 'HH':  
1202 - case 'hh':  
1203 - case 'mm':  
1204 - case 'ss':  
1205 - case 'ww':  
1206 - case 'WW':  
1207 - return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;  
1208 - case 'M':  
1209 - case 'D':  
1210 - case 'd':  
1211 - case 'H':  
1212 - case 'h':  
1213 - case 'm':  
1214 - case 's':  
1215 - case 'w':  
1216 - case 'W':  
1217 - case 'e':  
1218 - case 'E':  
1219 - return parseTokenOneOrTwoDigits;  
1220 - case 'Do':  
1221 - return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;  
1222 - default :  
1223 - a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i'));  
1224 - return a; 1174 + case 'DDD':
  1175 + return parseTokenOneToThreeDigits;
  1176 + case 'MMM':
  1177 + case 'MMMM':
  1178 + case 'dd':
  1179 + case 'ddd':
  1180 + case 'dddd':
  1181 + return parseTokenWord;
  1182 + case 'a':
  1183 + case 'A':
  1184 + return config._locale._meridiemParse;
  1185 + case 'x':
  1186 + return parseTokenOffsetMs;
  1187 + case 'X':
  1188 + return parseTokenTimestampMs;
  1189 + case 'Z':
  1190 + case 'ZZ':
  1191 + return parseTokenTimezone;
  1192 + case 'T':
  1193 + return parseTokenT;
  1194 + case 'SSSS':
  1195 + return parseTokenDigits;
  1196 + case 'MM':
  1197 + case 'DD':
  1198 + case 'YY':
  1199 + case 'GG':
  1200 + case 'gg':
  1201 + case 'HH':
  1202 + case 'hh':
  1203 + case 'mm':
  1204 + case 'ss':
  1205 + case 'ww':
  1206 + case 'WW':
  1207 + return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;
  1208 + case 'M':
  1209 + case 'D':
  1210 + case 'd':
  1211 + case 'H':
  1212 + case 'h':
  1213 + case 'm':
  1214 + case 's':
  1215 + case 'w':
  1216 + case 'W':
  1217 + case 'e':
  1218 + case 'E':
  1219 + return parseTokenOneOrTwoDigits;
  1220 + case 'Do':
  1221 + return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;
  1222 + default :
  1223 + a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i'));
  1224 + return a;
1225 } 1225 }
1226 } 1226 }
1227 1227
@@ -1240,141 +1240,141 @@ @@ -1240,141 +1240,141 @@
1240 var a, datePartArray = config._a; 1240 var a, datePartArray = config._a;
1241 1241
1242 switch (token) { 1242 switch (token) {
1243 - // QUARTER  
1244 - case 'Q':  
1245 - if (input != null) {  
1246 - datePartArray[MONTH] = (toInt(input) - 1) * 3;  
1247 - }  
1248 - break;  
1249 - // MONTH  
1250 - case 'M' : // fall through to MM  
1251 - case 'MM' :  
1252 - if (input != null) {  
1253 - datePartArray[MONTH] = toInt(input) - 1;  
1254 - }  
1255 - break;  
1256 - case 'MMM' : // fall through to MMMM  
1257 - case 'MMMM' :  
1258 - a = config._locale.monthsParse(input, token, config._strict);  
1259 - // if we didn't find a month name, mark the date as invalid.  
1260 - if (a != null) {  
1261 - datePartArray[MONTH] = a;  
1262 - } else {  
1263 - config._pf.invalidMonth = input;  
1264 - }  
1265 - break;  
1266 - // DAY OF MONTH  
1267 - case 'D' : // fall through to DD  
1268 - case 'DD' :  
1269 - if (input != null) {  
1270 - datePartArray[DATE] = toInt(input);  
1271 - }  
1272 - break;  
1273 - case 'Do' :  
1274 - if (input != null) {  
1275 - datePartArray[DATE] = toInt(parseInt(  
1276 - input.match(/\d{1,2}/)[0], 10));  
1277 - }  
1278 - break;  
1279 - // DAY OF YEAR  
1280 - case 'DDD' : // fall through to DDDD  
1281 - case 'DDDD' :  
1282 - if (input != null) {  
1283 - config._dayOfYear = toInt(input);  
1284 - }  
1285 -  
1286 - break;  
1287 - // YEAR  
1288 - case 'YY' :  
1289 - datePartArray[YEAR] = moment.parseTwoDigitYear(input);  
1290 - break;  
1291 - case 'YYYY' :  
1292 - case 'YYYYY' :  
1293 - case 'YYYYYY' :  
1294 - datePartArray[YEAR] = toInt(input);  
1295 - break;  
1296 - // AM / PM  
1297 - case 'a' : // fall through to A  
1298 - case 'A' :  
1299 - config._meridiem = input;  
1300 - // config._isPm = config._locale.isPM(input);  
1301 - break;  
1302 - // HOUR  
1303 - case 'h' : // fall through to hh  
1304 - case 'hh' :  
1305 - config._pf.bigHour = true; 1243 + // QUARTER
  1244 + case 'Q':
  1245 + if (input != null) {
  1246 + datePartArray[MONTH] = (toInt(input) - 1) * 3;
  1247 + }
  1248 + break;
  1249 + // MONTH
  1250 + case 'M' : // fall through to MM
  1251 + case 'MM' :
  1252 + if (input != null) {
  1253 + datePartArray[MONTH] = toInt(input) - 1;
  1254 + }
  1255 + break;
  1256 + case 'MMM' : // fall through to MMMM
  1257 + case 'MMMM' :
  1258 + a = config._locale.monthsParse(input, token, config._strict);
  1259 + // if we didn't find a month name, mark the date as invalid.
  1260 + if (a != null) {
  1261 + datePartArray[MONTH] = a;
  1262 + } else {
  1263 + config._pf.invalidMonth = input;
  1264 + }
  1265 + break;
  1266 + // DAY OF MONTH
  1267 + case 'D' : // fall through to DD
  1268 + case 'DD' :
  1269 + if (input != null) {
  1270 + datePartArray[DATE] = toInt(input);
  1271 + }
  1272 + break;
  1273 + case 'Do' :
  1274 + if (input != null) {
  1275 + datePartArray[DATE] = toInt(parseInt(
  1276 + input.match(/\d{1,2}/)[0], 10));
  1277 + }
  1278 + break;
  1279 + // DAY OF YEAR
  1280 + case 'DDD' : // fall through to DDDD
  1281 + case 'DDDD' :
  1282 + if (input != null) {
  1283 + config._dayOfYear = toInt(input);
  1284 + }
  1285 +
  1286 + break;
  1287 + // YEAR
  1288 + case 'YY' :
  1289 + datePartArray[YEAR] = moment.parseTwoDigitYear(input);
  1290 + break;
  1291 + case 'YYYY' :
  1292 + case 'YYYYY' :
  1293 + case 'YYYYYY' :
  1294 + datePartArray[YEAR] = toInt(input);
  1295 + break;
  1296 + // AM / PM
  1297 + case 'a' : // fall through to A
  1298 + case 'A' :
  1299 + config._meridiem = input;
  1300 + // config._isPm = config._locale.isPM(input);
  1301 + break;
  1302 + // HOUR
  1303 + case 'h' : // fall through to hh
  1304 + case 'hh' :
  1305 + config._pf.bigHour = true;
1306 /* falls through */ 1306 /* falls through */
1307 - case 'H' : // fall through to HH  
1308 - case 'HH' :  
1309 - datePartArray[HOUR] = toInt(input);  
1310 - break;  
1311 - // MINUTE  
1312 - case 'm' : // fall through to mm  
1313 - case 'mm' :  
1314 - datePartArray[MINUTE] = toInt(input);  
1315 - break;  
1316 - // SECOND  
1317 - case 's' : // fall through to ss  
1318 - case 'ss' :  
1319 - datePartArray[SECOND] = toInt(input);  
1320 - break;  
1321 - // MILLISECOND  
1322 - case 'S' :  
1323 - case 'SS' :  
1324 - case 'SSS' :  
1325 - case 'SSSS' :  
1326 - datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000);  
1327 - break;  
1328 - // UNIX OFFSET (MILLISECONDS)  
1329 - case 'x':  
1330 - config._d = new Date(toInt(input));  
1331 - break;  
1332 - // UNIX TIMESTAMP WITH MS  
1333 - case 'X':  
1334 - config._d = new Date(parseFloat(input) * 1000);  
1335 - break;  
1336 - // TIMEZONE  
1337 - case 'Z' : // fall through to ZZ  
1338 - case 'ZZ' :  
1339 - config._useUTC = true;  
1340 - config._tzm = utcOffsetFromString(input);  
1341 - break;  
1342 - // WEEKDAY - human  
1343 - case 'dd':  
1344 - case 'ddd':  
1345 - case 'dddd':  
1346 - a = config._locale.weekdaysParse(input);  
1347 - // if we didn't get a weekday name, mark the date as invalid  
1348 - if (a != null) {  
1349 - config._w = config._w || {};  
1350 - config._w['d'] = a;  
1351 - } else {  
1352 - config._pf.invalidWeekday = input;  
1353 - }  
1354 - break;  
1355 - // WEEK, WEEK DAY - numeric  
1356 - case 'w':  
1357 - case 'ww':  
1358 - case 'W':  
1359 - case 'WW':  
1360 - case 'd':  
1361 - case 'e':  
1362 - case 'E':  
1363 - token = token.substr(0, 1); 1307 + case 'H' : // fall through to HH
  1308 + case 'HH' :
  1309 + datePartArray[HOUR] = toInt(input);
  1310 + break;
  1311 + // MINUTE
  1312 + case 'm' : // fall through to mm
  1313 + case 'mm' :
  1314 + datePartArray[MINUTE] = toInt(input);
  1315 + break;
  1316 + // SECOND
  1317 + case 's' : // fall through to ss
  1318 + case 'ss' :
  1319 + datePartArray[SECOND] = toInt(input);
  1320 + break;
  1321 + // MILLISECOND
  1322 + case 'S' :
  1323 + case 'SS' :
  1324 + case 'SSS' :
  1325 + case 'SSSS' :
  1326 + datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000);
  1327 + break;
  1328 + // UNIX OFFSET (MILLISECONDS)
  1329 + case 'x':
  1330 + config._d = new Date(toInt(input));
  1331 + break;
  1332 + // UNIX TIMESTAMP WITH MS
  1333 + case 'X':
  1334 + config._d = new Date(parseFloat(input) * 1000);
  1335 + break;
  1336 + // TIMEZONE
  1337 + case 'Z' : // fall through to ZZ
  1338 + case 'ZZ' :
  1339 + config._useUTC = true;
  1340 + config._tzm = utcOffsetFromString(input);
  1341 + break;
  1342 + // WEEKDAY - human
  1343 + case 'dd':
  1344 + case 'ddd':
  1345 + case 'dddd':
  1346 + a = config._locale.weekdaysParse(input);
  1347 + // if we didn't get a weekday name, mark the date as invalid
  1348 + if (a != null) {
  1349 + config._w = config._w || {};
  1350 + config._w['d'] = a;
  1351 + } else {
  1352 + config._pf.invalidWeekday = input;
  1353 + }
  1354 + break;
  1355 + // WEEK, WEEK DAY - numeric
  1356 + case 'w':
  1357 + case 'ww':
  1358 + case 'W':
  1359 + case 'WW':
  1360 + case 'd':
  1361 + case 'e':
  1362 + case 'E':
  1363 + token = token.substr(0, 1);
1364 /* falls through */ 1364 /* falls through */
1365 - case 'gggg':  
1366 - case 'GGGG':  
1367 - case 'GGGGG':  
1368 - token = token.substr(0, 2);  
1369 - if (input) { 1365 + case 'gggg':
  1366 + case 'GGGG':
  1367 + case 'GGGGG':
  1368 + token = token.substr(0, 2);
  1369 + if (input) {
  1370 + config._w = config._w || {};
  1371 + config._w[token] = toInt(input);
  1372 + }
  1373 + break;
  1374 + case 'gg':
  1375 + case 'GG':
1370 config._w = config._w || {}; 1376 config._w = config._w || {};
1371 - config._w[token] = toInt(input);  
1372 - }  
1373 - break;  
1374 - case 'gg':  
1375 - case 'GG':  
1376 - config._w = config._w || {};  
1377 - config._w[token] = moment.parseTwoDigitYear(input); 1377 + config._w[token] = moment.parseTwoDigitYear(input);
1378 } 1378 }
1379 } 1379 }
1380 1380
@@ -1467,9 +1467,9 @@ @@ -1467,9 +1467,9 @@
1467 1467
1468 // Check for 24:00:00.000 1468 // Check for 24:00:00.000
1469 if (config._a[HOUR] === 24 && 1469 if (config._a[HOUR] === 24 &&
1470 - config._a[MINUTE] === 0 &&  
1471 - config._a[SECOND] === 0 &&  
1472 - config._a[MILLISECOND] === 0) { 1470 + config._a[MINUTE] === 0 &&
  1471 + config._a[SECOND] === 0 &&
  1472 + config._a[MILLISECOND] === 0) {
1473 config._nextDay = true; 1473 config._nextDay = true;
1474 config._a[HOUR] = 0; 1474 config._a[HOUR] = 0;
1475 } 1475 }
@@ -1576,7 +1576,7 @@ @@ -1576,7 +1576,7 @@
1576 } 1576 }
1577 // handle meridiem 1577 // handle meridiem
1578 config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], 1578 config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],
1579 - config._meridiem); 1579 + config._meridiem);
1580 dateFromConfig(config); 1580 dateFromConfig(config);
1581 checkOverflow(config); 1581 checkOverflow(config);
1582 } 1582 }
@@ -1746,8 +1746,8 @@ @@ -1746,8 +1746,8 @@
1746 } 1746 }
1747 1747
1748 /************************************ 1748 /************************************
1749 - Relative Time  
1750 - ************************************/ 1749 + Relative Time
  1750 + ************************************/
1751 1751
1752 1752
1753 // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize 1753 // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
@@ -1783,8 +1783,8 @@ @@ -1783,8 +1783,8 @@
1783 1783
1784 1784
1785 /************************************ 1785 /************************************
1786 - Week of Year  
1787 - ************************************/ 1786 + Week of Year
  1787 + ************************************/
1788 1788
1789 1789
1790 // firstDayOfWeek 0 = sun, 6 = sat 1790 // firstDayOfWeek 0 = sun, 6 = sat
@@ -1831,8 +1831,8 @@ @@ -1831,8 +1831,8 @@
1831 } 1831 }
1832 1832
1833 /************************************ 1833 /************************************
1834 - Top Level Functions  
1835 - ************************************/ 1834 + Top Level Functions
  1835 + ************************************/
1836 1836
1837 function makeMoment(config) { 1837 function makeMoment(config) {
1838 var input = config._i, 1838 var input = config._i,
@@ -1969,7 +1969,7 @@ @@ -1969,7 +1969,7 @@
1969 // duration 1969 // duration
1970 moment.duration = function (input, key) { 1970 moment.duration = function (input, key) {
1971 var duration = input, 1971 var duration = input,
1972 - // matching against regexp is expensive, do it on demand 1972 + // matching against regexp is expensive, do it on demand
1973 match = null, 1973 match = null,
1974 sign, 1974 sign,
1975 ret, 1975 ret,
@@ -2021,7 +2021,7 @@ @@ -2021,7 +2021,7 @@
2021 } else if (duration == null) {// checks for null or undefined 2021 } else if (duration == null) {// checks for null or undefined
2022 duration = {}; 2022 duration = {};
2023 } else if (typeof duration === 'object' && 2023 } else if (typeof duration === 'object' &&
2024 - ('from' in duration || 'to' in duration)) { 2024 + ('from' in duration || 'to' in duration)) {
2025 diffRes = momentsDifference(moment(duration.from), moment(duration.to)); 2025 diffRes = momentsDifference(moment(duration.from), moment(duration.to));
2026 2026
2027 duration = {}; 2027 duration = {};
@@ -2187,8 +2187,8 @@ @@ -2187,8 +2187,8 @@
2187 moment.isDate = isDate; 2187 moment.isDate = isDate;
2188 2188
2189 /************************************ 2189 /************************************
2190 - Moment Prototype  
2191 - ************************************/ 2190 + Moment Prototype
  2191 + ************************************/
2192 2192
2193 2193
2194 extend(moment.fn = Moment.prototype, { 2194 extend(moment.fn = Moment.prototype, {
@@ -2303,10 +2303,10 @@ @@ -2303,10 +2303,10 @@
2303 diff = this - that; 2303 diff = this - that;
2304 output = units === 'second' ? diff / 1e3 : // 1000 2304 output = units === 'second' ? diff / 1e3 : // 1000
2305 units === 'minute' ? diff / 6e4 : // 1000 * 60 2305 units === 'minute' ? diff / 6e4 : // 1000 * 60
2306 - units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60  
2307 - units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst  
2308 - units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst  
2309 - diff; 2306 + units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60
  2307 + units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  2308 + units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  2309 + diff;
2310 } 2310 }
2311 return asFloat ? output : absRound(output); 2311 return asFloat ? output : absRound(output);
2312 }, 2312 },
@@ -2328,10 +2328,10 @@ @@ -2328,10 +2328,10 @@
2328 diff = this.diff(sod, 'days', true), 2328 diff = this.diff(sod, 'days', true),
2329 format = diff < -6 ? 'sameElse' : 2329 format = diff < -6 ? 'sameElse' :
2330 diff < -1 ? 'lastWeek' : 2330 diff < -1 ? 'lastWeek' :
2331 - diff < 0 ? 'lastDay' :  
2332 - diff < 1 ? 'sameDay' :  
2333 - diff < 2 ? 'nextDay' :  
2334 - diff < 7 ? 'nextWeek' : 'sameElse'; 2331 + diff < 0 ? 'lastDay' :
  2332 + diff < 1 ? 'sameDay' :
  2333 + diff < 2 ? 'nextDay' :
  2334 + diff < 7 ? 'nextWeek' : 'sameElse';
2335 return this.format(this.localeData().calendar(format, this, moment(now))); 2335 return this.format(this.localeData().calendar(format, this, moment(now)));
2336 }, 2336 },
2337 2337
@@ -2341,7 +2341,7 @@ @@ -2341,7 +2341,7 @@
2341 2341
2342 isDST : function () { 2342 isDST : function () {
2343 return (this.utcOffset() > this.clone().month(0).utcOffset() || 2343 return (this.utcOffset() > this.clone().month(0).utcOffset() ||
2344 - this.utcOffset() > this.clone().month(5).utcOffset()); 2344 + this.utcOffset() > this.clone().month(5).utcOffset());
2345 }, 2345 },
2346 2346
2347 day : function (input) { 2347 day : function (input) {
@@ -2361,26 +2361,26 @@ @@ -2361,26 +2361,26 @@
2361 // the following switch intentionally omits break keywords 2361 // the following switch intentionally omits break keywords
2362 // to utilize falling through the cases. 2362 // to utilize falling through the cases.
2363 switch (units) { 2363 switch (units) {
2364 - case 'year':  
2365 - this.month(0); 2364 + case 'year':
  2365 + this.month(0);
2366 /* falls through */ 2366 /* falls through */
2367 - case 'quarter':  
2368 - case 'month':  
2369 - this.date(1); 2367 + case 'quarter':
  2368 + case 'month':
  2369 + this.date(1);
2370 /* falls through */ 2370 /* falls through */
2371 - case 'week':  
2372 - case 'isoWeek':  
2373 - case 'day':  
2374 - this.hours(0); 2371 + case 'week':
  2372 + case 'isoWeek':
  2373 + case 'day':
  2374 + this.hours(0);
2375 /* falls through */ 2375 /* falls through */
2376 - case 'hour':  
2377 - this.minutes(0); 2376 + case 'hour':
  2377 + this.minutes(0);
2378 /* falls through */ 2378 /* falls through */
2379 - case 'minute':  
2380 - this.seconds(0); 2379 + case 'minute':
  2380 + this.seconds(0);
2381 /* falls through */ 2381 /* falls through */
2382 - case 'second':  
2383 - this.milliseconds(0); 2382 + case 'second':
  2383 + this.milliseconds(0);
2384 /* falls through */ 2384 /* falls through */
2385 } 2385 }
2386 2386
@@ -2448,37 +2448,37 @@ @@ -2448,37 +2448,37 @@
2448 }, 2448 },
2449 2449
2450 min: deprecate( 2450 min: deprecate(
2451 - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',  
2452 - function (other) {  
2453 - other = moment.apply(null, arguments);  
2454 - return other < this ? this : other;  
2455 - }  
2456 - ), 2451 + 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
  2452 + function (other) {
  2453 + other = moment.apply(null, arguments);
  2454 + return other < this ? this : other;
  2455 + }
  2456 + ),
2457 2457
2458 max: deprecate( 2458 max: deprecate(
2459 - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',  
2460 - function (other) {  
2461 - other = moment.apply(null, arguments);  
2462 - return other > this ? this : other;  
2463 - } 2459 + 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
  2460 + function (other) {
  2461 + other = moment.apply(null, arguments);
  2462 + return other > this ? this : other;
  2463 + }
2464 ), 2464 ),
2465 2465
2466 zone : deprecate( 2466 zone : deprecate(
2467 - 'moment().zone is deprecated, use moment().utcOffset instead. ' +  
2468 - 'https://github.com/moment/moment/issues/1779',  
2469 - function (input, keepLocalTime) {  
2470 - if (input != null) {  
2471 - if (typeof input !== 'string') {  
2472 - input = -input;  
2473 - }  
2474 -  
2475 - this.utcOffset(input, keepLocalTime);  
2476 -  
2477 - return this;  
2478 - } else {  
2479 - return -this.utcOffset(); 2467 + 'moment().zone is deprecated, use moment().utcOffset instead. ' +
  2468 + 'https://github.com/moment/moment/issues/1779',
  2469 + function (input, keepLocalTime) {
  2470 + if (input != null) {
  2471 + if (typeof input !== 'string') {
  2472 + input = -input;
2480 } 2473 }
  2474 +
  2475 + this.utcOffset(input, keepLocalTime);
  2476 +
  2477 + return this;
  2478 + } else {
  2479 + return -this.utcOffset();
2481 } 2480 }
  2481 + }
2482 ), 2482 ),
2483 2483
2484 // keepLocalTime = true means only change the timezone, without 2484 // keepLocalTime = true means only change the timezone, without
@@ -2512,7 +2512,7 @@ @@ -2512,7 +2512,7 @@
2512 if (offset !== input) { 2512 if (offset !== input) {
2513 if (!keepLocalTime || this._changeInProgress) { 2513 if (!keepLocalTime || this._changeInProgress) {
2514 addOrSubtractDurationFromMoment(this, 2514 addOrSubtractDurationFromMoment(this,
2515 - moment.duration(input - offset, 'm'), 1, false); 2515 + moment.duration(input - offset, 'm'), 1, false);
2516 } else if (!this._changeInProgress) { 2516 } else if (!this._changeInProgress) {
2517 this._changeInProgress = true; 2517 this._changeInProgress = true;
2518 moment.updateOffset(this, true); 2518 moment.updateOffset(this, true);
@@ -2694,7 +2694,7 @@ @@ -2694,7 +2694,7 @@
2694 } 2694 }
2695 2695
2696 dayOfMonth = Math.min(mom.date(), 2696 dayOfMonth = Math.min(mom.date(),
2697 - daysInMonth(mom.year(), value)); 2697 + daysInMonth(mom.year(), value));
2698 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); 2698 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
2699 return mom; 2699 return mom;
2700 } 2700 }
@@ -2751,8 +2751,8 @@ @@ -2751,8 +2751,8 @@
2751 moment.fn.isUTC = moment.fn.isUtc; 2751 moment.fn.isUTC = moment.fn.isUtc;
2752 2752
2753 /************************************ 2753 /************************************
2754 - Duration Prototype  
2755 - ************************************/ 2754 + Duration Prototype
  2755 + ************************************/
2756 2756
2757 2757
2758 function daysToYears (days) { 2758 function daysToYears (days) {
@@ -2829,9 +2829,9 @@ @@ -2829,9 +2829,9 @@
2829 2829
2830 valueOf : function () { 2830 valueOf : function () {
2831 return this._milliseconds + 2831 return this._milliseconds +
2832 - this._days * 864e5 +  
2833 - (this._months % 12) * 2592e6 +  
2834 - toInt(this._months / 12) * 31536e6; 2832 + this._days * 864e5 +
  2833 + (this._months % 12) * 2592e6 +
  2834 + toInt(this._months / 12) * 31536e6;
2835 }, 2835 },
2836 2836
2837 humanize : function (withSuffix) { 2837 humanize : function (withSuffix) {
@@ -2984,19 +2984,19 @@ @@ -2984,19 +2984,19 @@
2984 }; 2984 };
2985 2985
2986 /************************************ 2986 /************************************
2987 - Default Locale  
2988 - ************************************/ 2987 + Default Locale
  2988 + ************************************/
2989 2989
2990 2990
2991 - // Set default locale, other locale will inherit from English. 2991 + // Set default locale, other locale will inherit from English.
2992 moment.locale('en', { 2992 moment.locale('en', {
2993 ordinalParse: /\d{1,2}(th|st|nd|rd)/, 2993 ordinalParse: /\d{1,2}(th|st|nd|rd)/,
2994 ordinal : function (number) { 2994 ordinal : function (number) {
2995 var b = number % 10, 2995 var b = number % 10,
2996 output = (toInt(number % 100 / 10) === 1) ? 'th' : 2996 output = (toInt(number % 100 / 10) === 1) ? 'th' :
2997 - (b === 1) ? 'st' :  
2998 - (b === 2) ? 'nd' :  
2999 - (b === 3) ? 'rd' : 'th'; 2997 + (b === 1) ? 'st' :
  2998 + (b === 2) ? 'nd' :
  2999 + (b === 3) ? 'rd' : 'th';
3000 return number + output; 3000 return number + output;
3001 } 3001 }
3002 }); 3002 });
@@ -3004,8 +3004,8 @@ @@ -3004,8 +3004,8 @@
3004 /* EMBED_LOCALES */ 3004 /* EMBED_LOCALES */
3005 3005
3006 /************************************ 3006 /************************************
3007 - Exposing Moment  
3008 - ************************************/ 3007 + Exposing Moment
  3008 + ************************************/
3009 3009
3010 function makeGlobal(shouldDeprecate) { 3010 function makeGlobal(shouldDeprecate) {
3011 /*global ender:false */ 3011 /*global ender:false */
@@ -3015,10 +3015,10 @@ @@ -3015,10 +3015,10 @@
3015 oldGlobalMoment = globalScope.moment; 3015 oldGlobalMoment = globalScope.moment;
3016 if (shouldDeprecate) { 3016 if (shouldDeprecate) {
3017 globalScope.moment = deprecate( 3017 globalScope.moment = deprecate(
3018 - 'Accessing Moment through the global scope is ' +  
3019 - 'deprecated, and will be removed in an upcoming ' +  
3020 - 'release.',  
3021 - moment); 3018 + 'Accessing Moment through the global scope is ' +
  3019 + 'deprecated, and will be removed in an upcoming ' +
  3020 + 'release.',
  3021 + moment);
3022 } else { 3022 } else {
3023 globalScope.moment = moment; 3023 globalScope.moment = moment;
3024 } 3024 }