mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
qt "github.com/frankban/quicktest"
|
||||
|
||||
"github.com/gohugoio/hugo/common/htime"
|
||||
translators "github.com/gohugoio/localescompressed"
|
||||
)
|
||||
|
||||
@@ -27,7 +28,7 @@ func TestTimeLocation(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
loc, _ := time.LoadLocation("America/Antigua")
|
||||
ns := New(translators.GetTranslator("en"), loc)
|
||||
ns := New(htime.NewTimeFormatter(translators.GetTranslator("en")), loc)
|
||||
|
||||
for i, test := range []struct {
|
||||
name string
|
||||
@@ -86,7 +87,7 @@ func TestFormat(t *testing.T) {
|
||||
|
||||
c.Run("UTC", func(c *qt.C) {
|
||||
c.Parallel()
|
||||
ns := New(translators.GetTranslator("en"), time.UTC)
|
||||
ns := New(htime.NewTimeFormatter(translators.GetTranslator("en")), time.UTC)
|
||||
|
||||
for i, test := range []struct {
|
||||
layout string
|
||||
@@ -129,7 +130,7 @@ func TestFormat(t *testing.T) {
|
||||
|
||||
loc, err := time.LoadLocation("America/Los_Angeles")
|
||||
c.Assert(err, qt.IsNil)
|
||||
ns := New(translators.GetTranslator("en"), loc)
|
||||
ns := New(htime.NewTimeFormatter(translators.GetTranslator("en")), loc)
|
||||
|
||||
d, err := ns.Format(":time_full", "2020-03-09T11:00:00")
|
||||
|
||||
@@ -143,7 +144,7 @@ func TestFormat(t *testing.T) {
|
||||
func TestDuration(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ns := New(translators.GetTranslator("en"), time.UTC)
|
||||
ns := New(htime.NewTimeFormatter(translators.GetTranslator("en")), time.UTC)
|
||||
|
||||
for i, test := range []struct {
|
||||
unit any
|
||||
|
Reference in New Issue
Block a user