[limb-svn] r5949 - in 3.x/trunk/limb/datetime: src tests/cases
svn at limb-project.com
svn at limb-project.com
Wed Jun 6 17:19:57 MSD 2007
Author: pachanga
Date: 2007-06-06 17:19:57 +0400 (Wed, 06 Jun 2007)
New Revision: 5949
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5949
Modified:
3.x/trunk/limb/datetime/src/lmbDate.class.php
3.x/trunk/limb/datetime/tests/cases/lmbDateTest.class.php
Log:
-- convenience lmbDate :: getIsoShortTime() added, it returns iso time without seconds
Modified: 3.x/trunk/limb/datetime/src/lmbDate.class.php
===================================================================
--- 3.x/trunk/limb/datetime/src/lmbDate.class.php 2007-06-06 10:25:32 UTC (rev 5948)
+++ 3.x/trunk/limb/datetime/src/lmbDate.class.php 2007-06-06 13:19:57 UTC (rev 5949)
@@ -1,19 +1,19 @@
<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
-lmb_require('limb/core/src/lmbObject.class.php');
-
+lmb_require('limb/core/src/lmbObject.class.php');
+
/**
* class lmbDate.
*
* @package datetime
* @version $Id$
- */
+ */
class lmbDate extends lmbObject
{
//YYYY-MM-DD HH:MM:SS timezone
@@ -258,6 +258,11 @@
$this->getHour(), $this->getMinute(), $this->getSecond());
}
+ function getIsoShortTime()
+ {
+ return $this->getIsoTime(false);
+ }
+
/**
* @deprecated
*/
Modified: 3.x/trunk/limb/datetime/tests/cases/lmbDateTest.class.php
===================================================================
--- 3.x/trunk/limb/datetime/tests/cases/lmbDateTest.class.php 2007-06-06 10:25:32 UTC (rev 5948)
+++ 3.x/trunk/limb/datetime/tests/cases/lmbDateTest.class.php 2007-06-06 13:19:57 UTC (rev 5949)
@@ -1,10 +1,10 @@
<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
lmb_require('limb/datetime/src/lmbDate.class.php');
lmb_require('limb/datetime/src/lmbDateTimeZone.class.php');
@@ -101,6 +101,12 @@
$this->assertEqual($date->getIsoTime(false), '12:45');
}
+ function testGetIsoShortTimeWithoutSeconds()
+ {
+ $date = new lmbDate(2005, 12, 1, 12, 45, 12);
+ $this->assertEqual($date->getIsoShortTime(), '12:45');
+ }
+
function testToStringReturnsIsoDate()
{
$date = new lmbDate(2005, 12, 1, 12, 45, 12);
More information about the limb-svn
mailing list