Преглед изворни кода

fixed current date in view.js

Piotr Labudda пре 7 година
родитељ
комит
312f5b8bb1
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 1 0
      tools/Bocian.php
  2. 2 1
      tools/Bocian.php.view.js

+ 1 - 0
tools/Bocian.php

@@ -189,6 +189,7 @@ public static $helpEmailTo = 'biuro@bialnet.com.pl'; // todo:email na który zos
 			'FIELD_LIST_KONTRAHENCI' => array_map(function ($fieldName) {
 				return "f_{$fieldName}";
 			}, self::$FIELD_LIST_KONTRAHENCI),
+			'CURRENT_DATE' => date("j.n.Y"),
 		]);
 		echo UI::h('script', ['src'=>"static/vendor.js?v=48ea11d6", 'type'=>"text/javascript"]);
 		UI::inlineJS(__FILE__ . '.addItemToRaport.js', [

+ 2 - 1
tools/Bocian.php.view.js

@@ -1,4 +1,5 @@
 var DBG = DBG || 0;
+var CURRENT_DATE = CURRENT_DATE || '';
 
 if (!URL_TABLE_POWIAZANIA) throw "Brak URL_TABLE_POWIAZANIA";
 if (!BASE_URLS) throw "Brak BASE_URLS"
@@ -47,7 +48,7 @@ function urlFetchKontrahenciPowiazania() {
  */
 function loadCurrentReaportTitleInInput(idInput) {
   var reaportTitleValue = getItemLocalStorage("Bocian.biAuditForm.smadReaportTitle");
-	var currentDate = new Date(day, month, year);
+	var currentDate = CURRENT_DATE;
   if ( getItemLocalStorage('Bocian.biAuditForm.smadReaportTitle') === null ) {
     reaportTitleValue = setItemLocalStorage('Bocian.biAuditForm.smadReaportTitle', 'Raport bez tytułu z dnia ' + currentDate);
   }