Esempio n. 1
0
 it("includes the start and end date", () => {
   const period = exhibitionPeriod(
     moment("2011-01-01"),
     moment("2014-04-19")
   )
   expect(period).toBe("Jan 1, 2011 – Apr 19, 2014")
 })
Esempio n. 2
0
 it("does not include the year of the end date if it’s in the current year", () => {
   const period = exhibitionPeriod(
     moment("2011-01-01"),
     moment().format("YYYY-04-19")
   )
   expect(period).toBe("Jan 1, 2011 – Apr 19")
 })
Esempio n. 3
0
 it("does not include a year at all if both start and end date are in the current year", () => {
   const period = exhibitionPeriod(
     moment().format("YYYY-01-01"),
     moment().format("YYYY-01-19")
   )
   expect(period).toBe("Jan 1 – 19")
 })
Esempio n. 4
0
 it("does not include the month of the end date if it’s the same as the start date", () => {
   const period = exhibitionPeriod(
     moment("2011-01-01"),
     moment("2011-01-19")
   )
   expect(period).toBe("Jan 1 – 19, 2011")
 })