Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
306 lines (265 sloc) 8.84 KB
---
Name : "DTime"
Version : "v1.0.0"
Notes : "Tests assume default time of 2020-05-13 14:34:54 -0500"
Sections :
- Name : "Time"
Tests :
- I : "2"
O : "2020-05-13 02:00:00 -0500, <nil>"
- I : "00"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "0003"
O : "2020-05-13 00:03:00 -0500, <nil>"
- I : "0000"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "03"
O : "2020-05-13 03:00:00 -0500, <nil>"
- I : "0305"
O : "2020-05-13 03:05:00 -0500, <nil>"
- I : "305"
O : "2020-05-13 03:05:00 -0500, <nil>"
- I : "15"
O : "2020-05-13 15:00:00 -0500, <nil>"
- I : "1504"
O : "2020-05-13 15:04:00 -0500, <nil>"
- I : "2359"
O : "2020-05-13 23:59:00 -0500, <nil>"
- I : "2400"
O : "<nil>, <nil>"
- Name : "TimeAMPM"
Tests:
- I : "12a"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "12am"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "12aM"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "12Am"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "12AM"
O : "2020-05-13 00:00:00 -0500, <nil>"
- I : "12p"
O : "2020-05-13 12:00:00 -0500, <nil>"
- I : "12pm"
O : "2020-05-13 12:00:00 -0500, <nil>"
- I : "12pM"
O : "2020-05-13 12:00:00 -0500, <nil>"
- I : "12Pm"
O : "2020-05-13 12:00:00 -0500, <nil>"
- I : "12PM"
O : "2020-05-13 12:00:00 -0500, <nil>"
- I : "3p"
O : "2020-05-13 15:00:00 -0500, <nil>"
- I : "3pm"
O : "2020-05-13 15:00:00 -0500, <nil>"
- I : "3a"
O : "2020-05-13 03:00:00 -0500, <nil>"
- I : "3am"
O : "2020-05-13 03:00:00 -0500, <nil>"
- I : "14pm"
O : "<nil>, <nil>"
- I : "14am"
O : "<nil>, <nil>"
- Name : "Weekday"
Tests :
- I : "mon"
O : "2020-05-11 00:00:00 -0500, <nil>"
- I : "monday"
O : "2020-05-11 00:00:00 -0500, <nil>"
O : "2020-05-11 00:00:00 -0500, <nil>"
- I : "thu"
O : "2020-05-14 00:00:00 -0500, <nil>"
- Name : "Month"
Tests :
- I : "jan"
O : "2020-01-01 00:00:00 -0500, <nil>"
- I : "january"
O : "2020-01-01 00:00:00 -0500, <nil>"
- I : "nov"
O : "2020-11-01 00:00:00 -0500, <nil>"
- I : "november"
O : "2020-11-01 00:00:00 -0500, <nil>"
- I : "dec"
O : "2020-12-01 00:00:00 -0500, <nil>"
- I : "december"
O : "2020-12-01 00:00:00 -0500, <nil>"
- I : "janx"
O : "<nil>, <nil>"
- Name : "Monthday"
Tests :
- I : "jan1"
O : "2020-01-01 00:00:00 -0500, <nil>"
- I : "january1"
O : "2020-01-01 00:00:00 -0500, <nil>"
- I : "nov3"
O : "2020-11-03 00:00:00 -0500, <nil>"
- I : "november3"
O : "2020-11-03 00:00:00 -0500, <nil>"
- Name : "Year"
Tests :
- I : ",2013"
O : "2013-01-01 00:00:00 -0500, <nil>"
- I : ",0"
O : "<nil>, <nil>"
- I : ",24243"
O : "24243-01-01 00:00:00 -0500, <nil>"
- Name : "Time Weekday"
Tests :
- I : "3p,mon"
O : "2020-05-11 15:00:00 -0500, <nil>"
- I : "15,monday"
O : "2020-05-11 15:00:00 -0500, <nil>"
- Name : "Time Month"
Tests :
- I : "3p,feb"
O : "2020-02-13 15:00:00 -0500, <nil>"
- I : "15,february"
O : "2020-02-13 15:00:00 -0500, <nil>"
- Name : "Time Monthday"
Tests :
- I : "3p,feb3"
O : "2020-02-03 15:00:00 -0500, <nil>"
- I : "15,february3"
O : "2020-02-03 15:00:00 -0500, <nil>"
- Name : "Time Year"
Tests :
- I : "3p,2013"
O : "2013-05-13 15:00:00 -0500, <nil>"
- I : "3a,2013"
O : "2013-05-13 03:00:00 -0500, <nil>"
- I : "304a,2013"
O : "2013-05-13 03:04:00 -0500, <nil>"
- I : "304p,2013"
O : "2013-05-13 15:04:00 -0500, <nil>"
- I : "15,2013"
O : "2013-05-13 15:00:00 -0500, <nil>"
- I : "02,2013"
O : "2013-05-13 02:00:00 -0500, <nil>"
- I : "2,2013"
O : "2013-05-13 02:00:00 -0500, <nil>"
- I : "304,2013"
O : "2013-05-13 03:04:00 -0500, <nil>"
- I : "4pm,2013"
O : "2013-05-13 16:00:00 -0500, <nil>"
- Name : "Time Weekday Year"
Tests :
- I : "3p,mon,2006"
O : "2006-05-11 15:00:00 -0500, <nil>"
- I : "15,monday,2006"
O : "2006-05-11 15:00:00 -0500, <nil>"
- Name : "Time Month Year"
Tests :
- I : "3p,feb,2006"
O : "2020-02-13 15:00:00 -0500, <nil>"
- I : "15,february,2006"
O : "2020-02-13 15:00:00 -0500, <nil>"
- Name : "Time Monthday Year"
Tests :
- I : "3p,feb,2006"
O : "2020-02-13 15:00:00 -0500, <nil>"
- I : "15,february,2006"
O : "2020-02-13 15:00:00 -0500, <nil>"
- Name : "Weekday Year"
Tests :
- I : "mon,2006"
O : "2006-05-11 00:00:00 -0500, <nil>"
- I : "monday,2006"
O : "2006-05-11 00:00:00 -0500, <nil>"
- Name : "Monthday Year"
Tests :
- I : "feb2,2006"
O : "2006-02-02 00:00:00 -0500, <nil>"
- I : "february2,2006"
O : "2006-02-02 00:00:00 -0500, <nil>"
- Name : "Offset"
Tests :
- I : "+1s"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:34:55 -0500"
- I : "+1.5s"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:34:55 -0500"
N : "always drops any decimals with seconds"
- I : "-1s"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:34:53 -0500"
- I : "-1.5s"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:34:52 -0500"
N : "always drops any decimals with seconds"
- I : "+1m"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:35:54 -0500"
- I : "+1.5m"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:36:24 -0500"
- I : "-1m"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:33:54 -0500"
- I : "-1.5m"
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:33:24 -0500"
- I : "+1d"
O : "2020-05-13 14:34:54 -0500, 2020-05-14 14:34:54 -0500"
- I : "+1.5d"
O : "2020-05-13 14:34:54 -0500, 2020-05-15 02:34:54 -0500"
- I : "-1d"
O : "2020-05-13 14:34:54 -0500, 2020-05-12 14:34:54 -0500"
- I : "-1.5d"
O : "2020-05-13 14:34:54 -0500, 2020-05-12 02:34:54 -0500"
- I : "+1w"
O : "2020-05-13 14:34:54 -0500, 2020-05-20 14:34:54 -0500"
- I : "+1.5w"
O : "2020-05-13 14:34:54 -0500, 2020-05-24 02:34:54 -0500"
- I : "-1w"
O : "2020-05-13 14:34:54 -0500, 2020-05-06 14:34:54 -0500"
- I : "-1.5w"
O : "2020-05-13 14:34:54 -0500, 2020-05-03 02:34:54 -0500"
- I : "+1y"
O : "2020-05-13 14:34:54 -0500, 2021-05-13 14:34:54 -0500"
- I : "+1.5y"
O : "2020-05-13 14:34:54 -0500, 2021-11-12 02:34:54 -0500"
- I : "-1y"
O : "2020-05-13 14:34:54 -0500, 2019-05-14 14:34:54 -0500"
- I : "-1.5y"
O : "2020-05-13 14:34:54 -0500, 2018-11-13 02:34:54 -0500"
- I : "-1.5Y"
O : "<nil>, <nil>"
N : "only lowercase offset duration units"
- I : "-1.5t"
O : "<nil>, <nil>"
N : "only ywdhms offset duration units allowed"
- I : "-1.5 h"
O : "<nil>, <nil>"
N : "no spaces allowed"
- Name : "Offset Combinations"
Tests:
- I : "+6y5w4d3h2m1s"
O : "2020-05-13 14:34:54 -0500, 2026-06-20 17:36:55 -0500"
- I : "-6y5w4d3h2m1s"
O : "2020-05-13 14:34:54 -0500, 2014-04-06 11:32:53 -0500"
- I : "+6.1y5.2w4.2d3.4h2.5m1.6s"
O : "2020-05-13 14:34:54 -0500, 2026-07-28 20:25:25 -0500"
N : "always drops any decimals with seconds"
- I : "-6.1y5.2w4.2d3.4h2.5m1.6s"
O : "2020-05-13 14:34:54 -0500, 2014-02-27 08:44:22 -0500"
N : "always drops any decimals with seconds"
- Name : "DateTime Offset"
Tests:
- I : "mon+1w"
O : "2020-05-11 00:00:00 -0500, 2020-05-18 00:00:00 -0500"
- I : "mon-1w"
O : "2020-05-11 00:00:00 -0500, 2020-05-04 00:00:00 -0500"
- I : "tue+20h"
O : "2020-05-12 00:00:00 -0500, 2020-05-12 20:00:00 -0500"
- I : "jan+20h"
O : "2020-01-01 00:00:00 -0500, 2020-01-01 20:00:00 -0500"
- I : "feb3-1d30m"
O : "2020-02-03 00:00:00 -0500, 2020-02-01 23:30:00 -0500"
- I : "6p,december10-1y"
O : "2020-12-10 18:00:00 -0500, 2019-12-11 18:00:00 -0500"
- I : "5,oct24,1999+1d"
O : "1999-10-24 05:00:00 -0500, 1999-10-25 05:00:00 -0500"
- Name : "This"
Tests :
- I : "."
O : "2020-05-13 14:34:54 -0500, 2020-05-13 14:34:54 -0500"
N : "now (this second for both)"
- I : ".m"
- I : ".d"
- I : ".w"
- I : ".M"
- I : ".y"
You can’t perform that action at this time.