1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00

日历相关计算

This commit is contained in:
2022-11-09 17:16:24 +08:00
parent 132bb0d0e2
commit 9203c3719f
5 changed files with 381 additions and 0 deletions

19
calendar/output_test.go Normal file
View File

@ -0,0 +1,19 @@
package calendar_test
import (
"testing"
"time"
"github.com/charlienet/go-mixed/calendar"
"github.com/stretchr/testify/assert"
)
func TestDayInt(t *testing.T) {
assert := assert.New(t)
n := time.Date(2022, 11, 9, 14, 28, 34, 123456789, time.UTC)
assert.Equal(20221109, calendar.Create(n).ToShortDateInt())
assert.Equal(202211, calendar.Create(n).ToMonthInt())
assert.Equal(20221109142834, calendar.Create(n).ToDateTimeInt())
}