Browse Source
Merge in DESIGN/design from ~LUCIAN.CHEN/design:feature/x to feature/x * commit 'b99e8ac96520e6e53ca09d02990a14edd924952e': REPORT-69887【日期控件专项优化】日期控件的格式设置为yyMMdd或yyMM时,前端显示不对feature/x
Lucian.Chen
3 years ago
2 changed files with 28 additions and 2 deletions
@ -0,0 +1,27 @@
|
||||
package com.fr.design.widget.ui.designer.date.check; |
||||
|
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
/** |
||||
* @author Lucian.Chen |
||||
* @version 10.0 |
||||
* Created by Lucian.Chen on 2022/4/18 |
||||
*/ |
||||
public class DateFormatFrontCheckTest { |
||||
|
||||
@Test |
||||
public void testAccept() { |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("20220101", "yyyyMMdd")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("202201", "yyyyMM")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("2022-01-01", "yyyy-MM-dd")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("22/01/01", "yy/MM/dd")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("2022年01月01日", "yyyy年MM月dd日")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("2022/01/01 12:30:00", "yyyy/MM/dd HH:mm:ss")); |
||||
|
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("220101", "yyMMdd")); |
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("20221", "yyyyM")); |
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("20220101123000", "yyyyMMddHHmmss")); |
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("2022-01-01", "YYYY-MM-dd")); |
||||
} |
||||
} |
Loading…
Reference in new issue