dokku
All checks were successful
Publish / deploy (push) Successful in 1m38s

This commit is contained in:
Lee 2023-11-21 14:15:20 +00:00
parent c7a91c7da0
commit 1071eeffd0
2 changed files with 25 additions and 5 deletions

@ -0,0 +1,21 @@
name: "Publish"
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Cloning repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to dokku
uses: dokku/github-action@master
with:
git_remote_url: "ssh://dokku@10.0.3.39:22/ss-pp-to-rank-overlay"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

@ -4,9 +4,8 @@
* @param timestamp the timestamp to format
* @returns the day count
*/
export function getDaysSince(timestamp: number) {
const now = new Date().getTime();
const diff = now - timestamp;
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
return days;
export function getDaysSince(timestamp: Date) {
const now = new Date();
const diff = now.getTime() - timestamp.getTime();
return Math.floor(diff / (1000 * 60 * 60 * 24));
}