config: use looseFormatTime type for since field

This commit is contained in:
c9s 2022-01-27 00:24:19 +08:00
parent ab07768a6d
commit cfc17acd20
2 changed files with 2 additions and 3 deletions

View File

@ -7,7 +7,6 @@ import (
"io/ioutil"
"reflect"
"runtime"
"time"
"github.com/pkg/errors"
"gopkg.in/yaml.v3"
@ -167,7 +166,7 @@ type SyncConfig struct {
Symbols []string `json:"symbols,omitempty" yaml:"symbols,omitempty"`
// Since is the date where you want to start syncing data
Since *time.Time `json:"since,omitempty"`
Since *types.LooseFormatTime `json:"since,omitempty"`
}
type Config struct {

View File

@ -78,7 +78,7 @@ var SyncCmd = &cobra.Command{
var syncStartTime = defaultSyncStartTime
if userConfig.Sync != nil && userConfig.Sync.Since != nil {
syncStartTime = *userConfig.Sync.Since
syncStartTime = userConfig.Sync.Since.Time()
}
if len(since) > 0 {