We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cf40d4 commit 87f2b99Copy full SHA for 87f2b99
src/DateUtils.js
@@ -21,11 +21,11 @@ export function dateByAddingSeconds(date, seconds) {
21
22
export function roundedMinute(date, rounding = Rounding.Nearest) {
23
const seconds = date.getUTCSeconds();
24
- let offset = 0;
25
- if (rounding === Rounding.Nearest) {
26
- offset = seconds >= 30 ? 60 - seconds : -1 * seconds;
27
- } else if (rounding === Rounding.Up) {
+ let offset = seconds >= 30 ? 60 - seconds : -1 * seconds;
+ if (rounding === Rounding.Up) {
28
offset = 60 - seconds;
+ } else if (rounding === Rounding.None) {
+ offset = 0;
29
}
30
31
return dateByAddingSeconds(date, offset);
0 commit comments