machinepack-datetime
Version:
Work the dates and times.
96 lines (95 loc) • 1.73 kB
JSON
{
"machine": "parse-date",
"expectations": [
{
"using": {
"monthDayYear": "May 5, 2015"
},
"outcome": "success",
"returns": {
"month": 5,
"date": 5,
"year": 2015,
"dayOfWeek": "Tuesday"
}
},
{
"using": {
"monthDayYear": "May 32, 2015"
},
"outcome": "couldNotParse"
},
{
"using": {
"monthDayYear": "5/31/1000"
},
"outcome": "success",
"returns": {
"month": 5,
"date": 31,
"year": 1000,
"dayOfWeek": "Saturday"
}
},
{
"using": {
"monthDayYear": "12-25-1999"
},
"outcome": "success",
"returns": {
"month": 12,
"date": 25,
"year": 1999,
"dayOfWeek": "Saturday"
}
},
{
"using": {
"monthDayYear": "12-25-2000"
},
"outcome": "success",
"returns": {
"month": 12,
"date": 25,
"year": 2000,
"dayOfWeek": "Monday"
}
},
{
"using": {
"monthDayYear": "2-30-2013"
},
"outcome": "success",
"returns": {
"month": 3,
"date": 2,
"year": 2013,
"dayOfWeek": "Saturday"
}
},
{
"using": {
"monthDayYear": "2-30-2012"
},
"outcome": "success",
"returns": {
"month": 3,
"date": 1,
"year": 2012,
"dayOfWeek": "Thursday"
}
},
{
"using": {
"monthDayYear": "1-1-2001"
},
"outcome": "success",
"returns": {
"month": 1,
"date": 1,
"year": 2001,
"dayOfWeek": "Monday"
}
}
]
}