[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 12/323: Rewriting periode : add format date +
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 12/323: Rewriting periode : add format date + exception |
Date: |
Wed, 14 Mar 2018 17:38:09 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 1d9a6e70737645e167ee542e9773e9f50d2b952a
Author: Dany De Bontridder <address@hidden>
Date: Sat Jan 6 16:39:10 2018 +0100
Rewriting periode : add format date + exception
---
include/lib/ac_common.php | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index f274230..7c0d5f5 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -762,6 +762,7 @@ function smaller_date($p_date)
* @brief format the date, when taken from the database the format
* is MM-DD-YYYY
* @param $p_date format
+ * @exception 1 if invalid format
* address@hidden
* @return date in the format DD.MM.YYYY
*/
@@ -788,6 +789,9 @@ function format_date($p_date, $p_from_format =
'YYYY-MM-DD',$p_to_format='DD.MM.
case 'DD.MM.YYYY':
$str_date = $date[2] . '.' . $date[1] . '.' . $date[0];
break;
+ case 'DD-MM-YYYY':
+ $str_date = $date[2] . '-' . $date[1] . '-' . $date[0];
+ break;
case 'YYYY-MM-DD':
$str_date = $date[0] . '-' . $date[1] . '-' . $date[2];
break;
@@ -797,7 +801,15 @@ function format_date($p_date, $p_from_format =
'YYYY-MM-DD',$p_to_format='DD.MM.
case 'YYYY/MM/DD':
$str_date = $date[0] . '/' . $date[1] . '/' . $date[2];
break;
-
+ case "DD.MM.YY":
+ $str_date = $date[2] . '.' . $date[1] . '.' . substr($date[0],2,2);
+ break;
+ case "DD-MM-YY":
+ $str_date = $date[2] . '-' . $date[1] . '-' . substr($date[0],2,2);
+ break;
+ default:
+ throw new Exception(_("Format Invalide"),1);
+
}
return $str_date;
}
- [Noalyss-commit] [noalyss] 07/323: Acc_Plan_MTable : add doxygen doc, (continued)
- [Noalyss-commit] [noalyss] 07/323: Acc_Plan_MTable : add doxygen doc, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 11/323: redirect incorrect : fix small bug, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 13/323: Add Documentation, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 18/323: cosmetic , add a button close for warning, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 17/323: query is prepared twice and cannot be called only once, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 05/323: Fix : script failed due to the lack of search_path, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 10/323: Acc_Plan_SQL : add doxygen doc, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 14/323: Update Doxyfile : version nb, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 15/323: Fix problem with font OpenSans, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 19/323: Task #1516 : Module période : add icon for closing / opening, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 12/323: Rewriting periode : add format date + exception,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 24/323: use calcy instead of computing the scroll, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 20/323: Add documentation , code rewriting : use of title_box, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 25/323: Task#1461 : nombre de fiches dans catégorie, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 27/323: set_jrn in deprecated and replaced by set_ledger, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 22/323: code rewriting : use of title_box + button close for Card Detail, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 28/323: Task #1466 : add a receipt number if paid by an ODS ledger, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 21/323: code rewriting : use of title_box + button close for Card Detail, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 26/323: Task#1461 : nombre de fiches dans catégorie, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 29/323: Task #1466 : add a receipt number if paid by an ODS ledger (Sale & Sold), Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 32/323: documentation, Dany De Bontridder, 2018/03/14