2010-07-02 06:54:49 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class DateFieldViewJQueryTest extends SapphireTest {
|
|
|
|
|
|
|
|
function testConvert() {
|
|
|
|
$this->assertEquals(
|
|
|
|
'M d, yy',
|
|
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('MMM d, yyyy')
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
'd/mm/yy',
|
|
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('d/MM/yyyy')
|
|
|
|
);
|
|
|
|
|
2010-10-31 01:54:38 +02:00
|
|
|
$this->assertEquals(
|
|
|
|
'dd.m.yy',
|
|
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('dd.M.yyyy'),
|
|
|
|
'Month, no leading zero'
|
|
|
|
);
|
|
|
|
|
2010-07-02 06:54:49 +02:00
|
|
|
$this->assertEquals(
|
|
|
|
'dd.mm.yy',
|
2010-10-31 01:54:38 +02:00
|
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('dd.MM.yyyy'),
|
|
|
|
'Month, two digit'
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
'dd.M.yy',
|
|
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('dd.MMM.yyyy'),
|
|
|
|
'Abbreviated month name'
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
'dd.MM.yy',
|
|
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('dd.MMMM.yyyy'),
|
|
|
|
'Full month name'
|
2010-07-02 06:54:49 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|