-
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
rakib
committed
Mar 5, 2025
1 parent
4bf490b
commit ea1451e
Showing
15 changed files
with
243 additions
and
126 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import moment from 'moment-timezone'; | ||
import { StateContext } from '../pages/_app'; | ||
import { useContext, useEffect } from 'react'; | ||
import { momentFormats } from '../shared/constants'; | ||
|
||
export default function Time({ dynamic = true, wSeconds = true }) { | ||
const { currentTime, setCurrentTime } = useContext<any>(StateContext); | ||
|
||
useEffect(() => { | ||
const updateTime = () => { | ||
const format = wSeconds ? momentFormats.wSeconds : momentFormats.default; | ||
setCurrentTime(moment().format(format)); | ||
} | ||
|
||
updateTime(); | ||
|
||
if (dynamic == true) { | ||
const interval = setInterval(updateTime, 1000); | ||
return () => clearInterval(interval); | ||
} | ||
}, [dynamic, wSeconds]) | ||
|
||
return <> | ||
<div className={`timeComponent`}> | ||
<div className={`timeElement`}> | ||
{currentTime} | ||
</div> | ||
</div> | ||
</> | ||
} |
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
Oops, something went wrong.
ea1451e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
product-ivf – ./
product-ivf.vercel.app
product-ivf-piratechs.vercel.app
productivf.com
productivf.vercel.app
www.productivf.com
product-ivf-git-main-piratechs.vercel.app