Fix date function
This commit is contained in:
parent
c16269d04e
commit
57a869683d
@ -105,6 +105,7 @@ For developers:
|
|||||||
- New: Add PRODUCT_PRICE_MODIFY trigger.
|
- New: Add PRODUCT_PRICE_MODIFY trigger.
|
||||||
- New: Created function to retrieve total amount of discount of an invoice/proposal...
|
- New: Created function to retrieve total amount of discount of an invoice/proposal...
|
||||||
- New: We can use a dynamic value ($conf->global->XXX for example) into titles of menus.
|
- New: We can use a dynamic value ($conf->global->XXX for example) into titles of menus.
|
||||||
|
- New: Use PHP classes DateTime* for some data functions instead of adodb
|
||||||
- Qual: Renamed SUPPLIER_INVOICE_BUILDDOC trigger to BILL_SUPPLIER_BUILDDOC
|
- Qual: Renamed SUPPLIER_INVOICE_BUILDDOC trigger to BILL_SUPPLIER_BUILDDOC
|
||||||
- Qual: Renamed INVOICE_SUPPLIER_DELETE trigger to BILL_SUPPLIER_DELETE
|
- Qual: Renamed INVOICE_SUPPLIER_DELETE trigger to BILL_SUPPLIER_DELETE
|
||||||
- Qual: Renamed SUPLIER_ORDER_BUILDDOC trigger to ORDER_SUPPLIER_BUILDDOC
|
- Qual: Renamed SUPLIER_ORDER_BUILDDOC trigger to ORDER_SUPPLIER_BUILDDOC
|
||||||
|
|||||||
@ -88,7 +88,7 @@ function getServerTimeZoneInt($refgmtdate='now')
|
|||||||
// Method 1 (include daylight)
|
// Method 1 (include daylight)
|
||||||
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d');
|
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d');
|
||||||
if ($refgmtdate == 'now') $newrefgmtdate=$yearref.'-'.$monthref.'-'.$dayref;
|
if ($refgmtdate == 'now') $newrefgmtdate=$yearref.'-'.$monthref.'-'.$dayref;
|
||||||
elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-05-15';
|
elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-08-01';
|
||||||
else $newrefgmtdate=$yearref.'-01-01';
|
else $newrefgmtdate=$yearref.'-01-01';
|
||||||
$localtz = new DateTimeZone(getServerTimeZoneString());
|
$localtz = new DateTimeZone(getServerTimeZoneString());
|
||||||
$localdt = new DateTime($newrefgmtdate, $localtz);
|
$localdt = new DateTime($newrefgmtdate, $localtz);
|
||||||
@ -773,7 +773,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha
|
|||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday);
|
dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day';
|
if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day';
|
||||||
if (! is_int($timestampEnd) && ! is_float($timestampEnd)) return 'ErrorBadParameter_num_open_day';
|
if (! is_int($timestampEnd) && ! is_float($timestampEnd)) return 'ErrorBadParameter_num_open_day';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user