Skip to content

2.29 Not present #58

@herculewyy

Description

@herculewyy
    var dd = "2023-01-30 12:45:23"

loc, _ := time.LoadLocation("Local")

dt, _ := time.ParseInLocation("2006-01-02 15:04:05", dd, loc)

r, _ = rrule.NewRRule(rrule.ROption{
	Freq: rrule.MONTHLY,
	//Bymonthday: []int{},
	//	Bymonth:    []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, // 取哪一月的数据
	Interval: 1,
	Until:    time.Now().AddDate(0, 5, 0),
	Dtstart:  dt,
})

//set.ExDate(time.Now())
for _, t2 := range r.All() {
	fmt.Println(t2.Format("2006-01-02 15:04:05"))
}

result:
2023-01-30 12:45:23
2023-03-30 12:45:23
2023-04-30 12:45:23
2023-05-30 12:45:23
2023-06-30 12:45:23

2023-02-28 12:45:23 How to achieve?

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions