Skip to content

Commit

Permalink
Release v4.13.6 (#20)
Browse files Browse the repository at this point in the history
* Change release day to Tuesday

* Release v4.13.6
  • Loading branch information
WRadoslaw committed Nov 10, 2023
1 parent 8ac7fa9 commit ea8b9a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/atlas/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@joystream/atlas",
"description": "UI for consuming Joystream - a user governed video platform",
"version": "4.13.1",
"version": "4.13.6",
"license": "GPL-3.0",
"scripts": {
"start": "vite",
Expand Down
5 changes: 3 additions & 2 deletions packages/atlas/src/utils/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ export const convertDateFormat = (timestamp: Date | string) => {
return timestamp instanceof Date ? timestamp : parseISO(timestamp)
}

export const getNextFriday = (date = new Date()) => {
// weekday: 1 - monday, 2 - tuesday ... 7- sunday
export const getNextWeekday = (date = new Date(), weekday = 1) => {
const nextDate = new Date(date)
const currentDayOfWeek = nextDate.getDay()
const daysToAdd = currentDayOfWeek <= 5 ? 5 - currentDayOfWeek : 7 - currentDayOfWeek + 5
const daysToAdd = currentDayOfWeek <= weekday ? weekday - currentDayOfWeek : 7 - currentDayOfWeek + weekday
nextDate.setDate(nextDate.getDate() + daysToAdd)
return nextDate
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useMediaMatch } from '@/hooks/useMediaMatch'
import { useYppAuthorizeHandler } from '@/hooks/useYppAuthorizeHandler'
import { usePersonalDataStore } from '@/providers/personalData'
import { useUser } from '@/providers/user/user.hooks'
import { formatDate, getNextFriday } from '@/utils/time'
import { formatDate, getNextWeekday } from '@/utils/time'
import { BOOST_TIMESTAMP, getTierRewards, yppBackendTierToConfig } from '@/utils/ypp'
import { YppAuthorizationModal } from '@/views/global/YppLandingView/YppAuthorizationModal'
import { configYppIconMapper } from '@/views/global/YppLandingView/sections/YppFooter'
Expand Down Expand Up @@ -53,7 +53,7 @@ export const YppDashboardMainTab: FC = () => {
const mdMatch = useMediaMatch('md')
const smMatch = useMediaMatch('sm')
const lgMatch = useMediaMatch('lg')
const nextPayoutDate = getNextFriday()
const nextPayoutDate = getNextWeekday(new Date(), 2)
const rewardMultiplier =
new Date(currentChannel?.createdAt || 0).getTime() > BOOST_TIMESTAMP
? atlasConfig.features.ypp.tierBoostMultiplier || 1
Expand Down Expand Up @@ -109,7 +109,7 @@ export const YppDashboardMainTab: FC = () => {
<WidgetTile
title="Next payments round"
tooltip={{
text: 'All of the payments are processed every Friday. The hour of payouts may vary.',
text: 'All of the payments are processed every Tuesday. The hour of payouts may vary.',
placement: 'top-start',
}}
customNode={
Expand Down

0 comments on commit ea8b9a0

Please sign in to comment.