aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/com/healthmarketscience/jackcess
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2018-11-13 04:59:29 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2018-11-13 04:59:29 +0000
commitac6811e50d1f32a4eb14785282099c316dcfc7fd (patch)
tree89e1131802c32bb0b9ac39cc6510dabcfe6eaecd /src/test/java/com/healthmarketscience/jackcess
parent25069267ebe8d5f9028d51c2fbe7fb0217e5a07f (diff)
downloadjackcess-ac6811e50d1f32a4eb14785282099c316dcfc7fd.tar.gz
jackcess-ac6811e50d1f32a4eb14785282099c316dcfc7fd.zip
implement FormatDateTime function
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1221 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com/healthmarketscience/jackcess')
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/PropertyExpressionTest.java1
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/PropertyExpressionTest.java b/src/test/java/com/healthmarketscience/jackcess/PropertyExpressionTest.java
index ffb2dd3..384386e 100644
--- a/src/test/java/com/healthmarketscience/jackcess/PropertyExpressionTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/PropertyExpressionTest.java
@@ -295,6 +295,7 @@ public class PropertyExpressionTest extends TestCase
public static void testCustomEvalConfig() throws Exception
{
TemporalConfig tempConf = new TemporalConfig("yyyy/M/d", "M/d",
+ "yyyy-MMM-d",
"hh.mm.ss a",
"HH.mm.ss", '/', '.',
Locale.US);
diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
index f40a1de..fdab104 100644
--- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
@@ -253,6 +253,14 @@ public class DefaultFunctionsTest extends TestCase
assertEval("($12.34)", "=FormatCurrency(-12.345,-1,True,True)");
assertEval("$12", "=FormatCurrency(12.345,0,True,True)");
assertEval("-$.123", "=FormatCurrency(-0.12345,3,False)");
+
+ assertEval("1/1/1973 1:37:25 PM", "=FormatDateTime(#1/1/1973 1:37:25 PM#)");
+ assertEval("1:37:25 PM", "=FormatDateTime(#1:37:25 PM#,0)");
+ assertEval("1/1/1973", "=FormatDateTime(#1/1/1973#,0)");
+ assertEval("Monday, January 01, 1973", "=FormatDateTime(#1/1/1973 1:37:25 PM#,1)");
+ assertEval("1/1/1973", "=FormatDateTime(#1/1/1973 1:37:25 PM#,2)");
+ assertEval("1:37:25 PM", "=FormatDateTime(#1/1/1973 1:37:25 PM#,3)");
+ assertEval("13:37", "=FormatDateTime(#1/1/1973 1:37:25 PM#,4)");
}
public void testNumberFuncs() throws Exception