Redmage/views/components/dayjs.templ

17 lines
783 B
Plaintext
Raw Normal View History

2024-04-30 15:28:04 +07:00
package components
2024-05-01 16:10:04 +07:00
import "fmt"
import "github.com/tigorlazuardi/redmage/views"
templ Dayjs(c *views.Context) {
<script src={ fmt.Sprintf("/public/dayjs-%s.min.js", c.Config.String("web.dependencies.dayjs.version")) }></script>
<script src={ fmt.Sprintf("/public/dayjs-relativeTime-%s.min.js", c.Config.String("web.dependencies.dayjs.version")) }></script>
<script src={ fmt.Sprintf("/public/dayjs-utc-%s.min.js", c.Config.String("web.dependencies.dayjs.version")) }></script>
<script src={ fmt.Sprintf("/public/dayjs-timezone-%s.min.js", c.Config.String("web.dependencies.dayjs.version")) }></script>
2024-04-30 15:28:04 +07:00
<script>
dayjs.extend(window.dayjs_plugin_relativeTime)
dayjs.extend(window.dayjs_plugin_utc)
dayjs.extend(window.dayjs_plugin_timezone)
</script>
}