Added date render for partial date information

This commit is contained in:
Eduard Urbach 2018-04-26 00:00:34 +02:00
parent 83987964ba
commit 4fef7813ac

View File

@ -195,20 +195,31 @@ component AnimeInformation(anime *arn.Anime)
td.anime-info-value= anime.StatusHumanReadable()
if anime.StartDate == anime.EndDate && validate.Date(anime.StartDate) && validate.Date(anime.EndDate)
tr.mountable(data-mountable-type="info")
td.anime-info-key Airing date:
td.anime-info-value= anime.StartDateTime().Format("Jan _2, 2006")
else
if anime.StartDate != ""
tr.mountable(data-mountable-type="info")
td.anime-info-key Airing date:
td.anime-info-value= anime.StartDateTime().Format("Jan _2, 2006")
else
if validate.Date(anime.StartDate)
tr.mountable(data-mountable-type="info")
td.anime-info-key Start:
td.anime-info-value= anime.StartDateTime().Format("Jan _2, 2006")
if validate.Date(anime.EndDate)
if validate.Date(anime.StartDate)
td.anime-info-value= anime.StartDateTime().Format("Jan _2, 2006")
else if len(anime.StartDate) >= len("2006-01")
td.anime-info-value= anime.StartDateTime().Format("Jan, 2006")
else
td.anime-info-value= anime.StartDate
if anime.EndDate != ""
tr.mountable(data-mountable-type="info")
td.anime-info-key End:
td.anime-info-value= anime.EndDateTime().Format("Jan _2, 2006")
if validate.Date(anime.EndDate)
td.anime-info-value= anime.EndDateTime().Format("Jan _2, 2006")
else if len(anime.EndDate) >= len("2006-01")
td.anime-info-value= anime.EndDateTime().Format("Jan, 2006")
else
td.anime-info-value= anime.EndDate
if anime.Season() != ""
tr.mountable(data-mountable-type="info")