mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 17:05:50 +02:00
7ecbf49ac9
git-svn-id: http://svn.silverstripe.com/projects/ss2doc/branches/v2@117896 467b73ca-7a2a-4603-9d3b-597d59a354a9
43 lines
929 B
PHP
43 lines
929 B
PHP
<?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')
|
|
);
|
|
|
|
$this->assertEquals(
|
|
'dd.m.yy',
|
|
DateField_View_JQuery::convert_iso_to_jquery_format('dd.M.yyyy'),
|
|
'Month, no leading zero'
|
|
);
|
|
|
|
$this->assertEquals(
|
|
'dd.mm.yy',
|
|
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'
|
|
);
|
|
}
|
|
} |