-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68e7048
commit 84f33aa
Showing
17 changed files
with
90 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package waktu_test | ||
|
||
import ( | ||
. "github.com/gomodul/waktu" | ||
) | ||
|
||
var now = Date(1993, 9, 10, 13, 37, 11, 11, GetLocationByUTCOffset(7)) //nolint:gochecknoglobals,nolintlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package waktu | ||
package waktu_test | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package waktu | ||
|
||
// StartOfDay ex: 1993-09-10 00:00:00 +0700 GMT+7 | ||
// StartOfDay ex: 1993-09-10 00:00:00 +0700 GMT+7. | ||
func (t Time) StartOfDay() Time { | ||
return t.ResetTimeLocal() | ||
} | ||
|
||
// StartOfWeek ex: 1993-09-05 00:00:00 +0700 GMT+7 | ||
// StartOfWeek ex: 1993-09-05 00:00:00 +0700 GMT+7. | ||
func (t Time) StartOfWeek(startWeek ...Weekday) Time { | ||
weekday := int(t.Weekday()) | ||
if len(startWeek) > 0 { | ||
weekday -= int(startWeek[0]) | ||
} | ||
|
||
return t.AddDate(0, 0, -weekday).StartOfDay() | ||
} | ||
|
||
// StartOfMonth ex: 1993-09-01 00:00:00 +0700 GMT+7 | ||
// StartOfMonth ex: 1993-09-01 00:00:00 +0700 GMT+7. | ||
func (t Time) StartOfMonth() Time { | ||
return Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, t.Location()) | ||
} | ||
|
||
// StartOfYear ex: 1993-01-01 00:00:00 +0700 GMT+7 | ||
// StartOfYear ex: 1993-01-01 00:00:00 +0700 GMT+7. | ||
func (t Time) StartOfYear() Time { | ||
return Date(t.Year(), 1, 1, 0, 0, 0, 0, t.Location()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package waktu | ||
|
||
// Version current version | ||
// Version current version. | ||
const Version = "v0.0.1-alpha.1" |
Oops, something went wrong.