|
From: <Ex...@us...> - 2012-03-22 03:15:17
|
Revision: 5123
http://web-erp.svn.sourceforge.net/web-erp/?rev=5123&view=rev
Author: ExsonQu
Date: 2012-03-22 03:15:10 +0000 (Thu, 22 Mar 2012)
Log Message:
-----------
22/3/2012 Exson: Fixed period displayed incorrectly in GL inquiry in Win OS since the strftime() encoding is not UTF-8. Reported by CQZ and KE in webERP Chinese Community QQ group.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2012-03-21 10:44:31 UTC (rev 5122)
+++ trunk/includes/DateFunctions.inc 2012-03-22 03:15:10 UTC (rev 5123)
@@ -94,9 +94,18 @@
if (mb_strlen($Date_Array[2])>4) {
$Date_Array[2]= mb_substr($Date_Array[2],0,2);
}
-
- return ucfirst(strftime('%B %Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])));
-
+ $str = strftime('%B %Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]));
+ //This code to handle characters in windows system which not encoded in UTF-8. Those non-utf8 code leads to display garbage
+ $encode = mb_detect_encoding($str,'GB2312,BIG5,UTF-8');
+
+ if($encode=='EUC-CN'){
+ return iconv('GB2312','UTF-8',$str);
+ }elseif($encode=='EUC-TW'){
+ return iconv('BIG5','UTF-8', $str);
+ }else{
+ return ucfirst($str);
+ }
+
}
function DayOfWeekFromSQLDate($DateEntry) {
@@ -951,4 +960,4 @@
}
-?>
\ No newline at end of file
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ex...@us...> - 2012-03-22 03:15:16
|
Revision: 5123
http://web-erp.svn.sourceforge.net/web-erp/?rev=5123&view=rev
Author: ExsonQu
Date: 2012-03-22 03:15:10 +0000 (Thu, 22 Mar 2012)
Log Message:
-----------
22/3/2012 Exson: Fixed period displayed incorrectly in GL inquiry in Win OS since the strftime() encoding is not UTF-8. Reported by CQZ and KE in webERP Chinese Community QQ group.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2012-03-21 10:44:31 UTC (rev 5122)
+++ trunk/includes/DateFunctions.inc 2012-03-22 03:15:10 UTC (rev 5123)
@@ -94,9 +94,18 @@
if (mb_strlen($Date_Array[2])>4) {
$Date_Array[2]= mb_substr($Date_Array[2],0,2);
}
-
- return ucfirst(strftime('%B %Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])));
-
+ $str = strftime('%B %Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]));
+ //This code to handle characters in windows system which not encoded in UTF-8. Those non-utf8 code leads to display garbage
+ $encode = mb_detect_encoding($str,'GB2312,BIG5,UTF-8');
+
+ if($encode=='EUC-CN'){
+ return iconv('GB2312','UTF-8',$str);
+ }elseif($encode=='EUC-TW'){
+ return iconv('BIG5','UTF-8', $str);
+ }else{
+ return ucfirst($str);
+ }
+
}
function DayOfWeekFromSQLDate($DateEntry) {
@@ -951,4 +960,4 @@
}
-?>
\ No newline at end of file
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ex...@us...> - 2012-03-23 15:03:57
|
Revision: 5144
http://web-erp.svn.sourceforge.net/web-erp/?rev=5144&view=rev
Author: ExsonQu
Date: 2012-03-23 15:03:48 +0000 (Fri, 23 Mar 2012)
Log Message:
-----------
23/3/2012 Exson: Fixed accounting period displayed abnormal in simplified Chinese language in Win OS. Reported by CQZ from webERP Chinese community QQ group.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2012-03-23 14:52:18 UTC (rev 5143)
+++ trunk/includes/DateFunctions.inc 2012-03-23 15:03:48 UTC (rev 5144)
@@ -100,7 +100,7 @@
if($encode=='EUC-CN'){
return iconv('GB2312','UTF-8',$str);
- }elseif($encode=='EUC-TW'){
+ }elseif($encode=='EUC-TW' or $encode=='BIG-5'){
return iconv('BIG5','UTF-8', $str);
}else{
return ucfirst($str);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Ex...@us...> - 2012-03-23 15:03:58
|
Revision: 5144
http://web-erp.svn.sourceforge.net/web-erp/?rev=5144&view=rev
Author: ExsonQu
Date: 2012-03-23 15:03:48 +0000 (Fri, 23 Mar 2012)
Log Message:
-----------
23/3/2012 Exson: Fixed accounting period displayed abnormal in simplified Chinese language in Win OS. Reported by CQZ from webERP Chinese community QQ group.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2012-03-23 14:52:18 UTC (rev 5143)
+++ trunk/includes/DateFunctions.inc 2012-03-23 15:03:48 UTC (rev 5144)
@@ -100,7 +100,7 @@
if($encode=='EUC-CN'){
return iconv('GB2312','UTF-8',$str);
- }elseif($encode=='EUC-TW'){
+ }elseif($encode=='EUC-TW' or $encode=='BIG-5'){
return iconv('BIG5','UTF-8', $str);
}else{
return ucfirst($str);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dai...@us...> - 2013-04-17 10:02:50
|
Revision: 5845
http://sourceforge.net/p/web-erp/reponame/5845
Author: daintree
Date: 2013-04-17 10:02:47 +0000 (Wed, 17 Apr 2013)
Log Message:
-----------
Kalmer Piiskop - Date1GreaterThanDate2 returned true when dates were equal - fixed
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2013-04-16 08:36:23 UTC (rev 5844)
+++ trunk/includes/DateFunctions.inc 2013-04-17 10:02:47 UTC (rev 5845)
@@ -707,8 +707,8 @@
return 0;
}
- /* The dates are equal, so return an error state */
- return 1;
+ /* The dates are equal, so return false as date 1 is NOT greater than date 2 */
+ return 0;
}
|
|
From: <ex...@us...> - 2014-02-12 03:04:29
|
Revision: 6569
http://sourceforge.net/p/web-erp/reponame/6569
Author: exsonqu
Date: 2014-02-12 03:04:26 +0000 (Wed, 12 Feb 2014)
Log Message:
-----------
14/2/2014 Exson: Fixed the Earliest date calculation when is over Friday cutoff Time in DateFunctions.inc.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2014-02-10 15:09:27 UTC (rev 6568)
+++ trunk/includes/DateFunctions.inc 2014-02-12 03:04:26 UTC (rev 6569)
@@ -922,6 +922,9 @@
* */
$EarliestDispatch = time();
+ /* If the hour is after Dispatch Cut Off Time default dispatch date to tomorrow */
+ $EarliestDispatch = (Date('H')>=$_SESSION['DispatchCutOffTime'])?($EarliestDispatch+24*60*60):$EarliestDispatch;
+
if ((Date('w',$EarliestDispatch)==0) AND ($_SESSION['WorkingDaysWeek'] != '7')){
/*if today is a sunday AND the company does NOT work 7 days a week, the dispatch date must be tomorrow (Monday) or after */
@@ -934,11 +937,9 @@
$EarliestDispatch = Mktime(0,0,0,Date('m',$EarliestDispatch),Date('d',$EarliestDispatch)+2,Date('y',$EarliestDispatch));
- }elseif (Date('H')>$_SESSION['DispatchCutOffTime']) {
+ }else {
-/* If the hour is after Dispatch Cut Off Time default dispatch date to tomorrow */
-
- $EarliestDispatch = Mktime(0,0,0,Date('m'),Date('d')+1,Date('y'));
+ $EarliestDispatch = Mktime(0,0,0,Date('m'),Date('d'),Date('y'));
}
return $EarliestDispatch;
}
@@ -1080,4 +1081,4 @@
return $myrow[0];
}
-?>
\ No newline at end of file
+?>
|
|
From: <rc...@us...> - 2016-04-29 23:51:51
|
Revision: 7500
http://sourceforge.net/p/web-erp/reponame/7500
Author: rchacon
Date: 2016-04-29 23:51:49 +0000 (Fri, 29 Apr 2016)
Log Message:
-----------
Add year in long date and time in locale format.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2016-04-28 02:53:14 UTC (rev 7499)
+++ trunk/includes/DateFunctions.inc 2016-04-29 23:51:49 UTC (rev 7500)
@@ -173,8 +173,28 @@
return $Day;
}
-function DisplayDateTime () {
- return GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('G:i') ;
+function DisplayDateTime() {
+ // Long date and time in locale format.
+ // Could be replace by IntlDateFormatter (available on PHP 5.3.0 or later). See http://php.net/manual/en/class.intldateformatter.php
+ switch ($_SESSION['Language']) {
+ case 'en_GB.utf8':
+ $long_datetime = GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('Y') . ' ' . date('G:i');
+ break;
+ case 'en_US.utf8':
+ $long_datetime = GetWeekDayText(date('w')) . ', ' . GetMonthText(date('n')) . ' ' . date('j') . ', '. date('Y') . ' ' . date('G:i');
+ break;
+ case 'es_ES.utf8':
+ $long_datetime = GetWeekDayText(date('w')) . ' ' . date('j') . ' de ' . GetMonthText(date('n')) . ' de ' . date('Y') . ' ' . date('G:i');
+ break;
+ case 'fr_FR.utf8':
+ $long_datetime = GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('Y') . ' ' . date('G:i');
+ break;
+ default:
+ $long_datetime = GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('Y') . ' ' . date('G:i');
+ break;
+ }
+ return $long_datetime;
+/* return GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('G:i') ;*/
}
function DayOfWeekFromSQLDate($DateEntry) {
|
|
From: <ex...@us...> - 2016-08-24 09:03:11
|
Revision: 7600
http://sourceforge.net/p/web-erp/reponame/7600
Author: exsonqu
Date: 2016-08-24 09:03:08 +0000 (Wed, 24 Aug 2016)
Log Message:
-----------
24/9/16 Exson: Fixed the bug that days of payment terms in the following month over 31 days can not be handled correctly in DateFunctions.inc.
Modified Paths:
--------------
trunk/includes/DateFunctions.inc
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2016-08-21 03:11:43 UTC (rev 7599)
+++ trunk/includes/DateFunctions.inc 2016-08-24 09:03:08 UTC (rev 7600)
@@ -752,8 +752,11 @@
$YearDue = $Date_Array[2];
} elseif($DayInFollowingMonth>=29) { //take the last day of month
-
- $DayDue = 0;
+ if ($DayInFollowingMonth <= 31) {
+ $DayDue = 0;
+ } else {
+ $DayDue = $DayInFollowingMonth-31;
+ }
$MonthDue = $Date_Array[1]+2;
$YearDue = $Date_Array[2];
} else {
@@ -769,8 +772,11 @@
$YearDue = $Date_Array[2];
} elseif($DayInFollowingMonth>=29) { //take the last day of month
-
- $DayDue = 0;
+ if ($DayInFollowingMonth <= 31) {
+ $DayDue = 0;
+ } else {
+ $DayDue = $DayInFollowingMonth-31;
+ }
$MonthDue = $Date_Array[0]+2;
$YearDue = $Date_Array[2];
} else {
@@ -786,7 +792,11 @@
} elseif($DayInFollowingMonth>=29) { //take the last day of month
- $DayDue = 0;
+ if ($DayInFollowingMonth <= 31) {
+ $DayDue = 0;
+ } else {
+ $DayDue = $DayInFollowingMonth-31;
+ }
$MonthDue = $Date_Array[1]+2;
$YearDue = $Date_Array[0];
} else {
@@ -1104,4 +1114,4 @@
return $myrow[0];
}
-?>
\ No newline at end of file
+?>
|