feat(ary-this-week): initial commit

This commit is contained in:
dancingCycle 2022-05-31 06:39:27 +02:00
parent e4a25a851a
commit 7ffe5badc7
5 changed files with 66 additions and 0 deletions

1
ary-this-week/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env*

21
ary-this-week/README.md Normal file
View File

@ -0,0 +1,21 @@
## Overview
tbc
## Preparation
Run the following command in your favorite terminal to install dependenies.
```
npm i
```
## Development setup
Run the following command in your favorite terminal if you fancy log messages for debugging.
```
export DEBUG=$DEBUG,debug,ary-this-week
```
Run the following command in your favorite terminal to start the service in development mode.
```
npm run dev
```
## Production deployment
tbc

View File

@ -0,0 +1,13 @@
function getAryThisWeek(date){
const dateToday=new Date();
let dateIncrement=new Date(dateToday);
aryThisWeek=[];
for(var i=0;i<7;i++){
aryThisWeek[i]=new Date(dateIncrement);
dateIncrement=new Date(dateIncrement.setDate(dateIncrement.getDate()+1));
}
return aryThisWeek;
}
module.exports={
getAryThisWeek
};

15
ary-this-week/index.js Normal file
View File

@ -0,0 +1,15 @@
const Debug=require('debug')('debug');
const AryThisWeek=require('./ary-this-week');
run().catch(err => {
Debug('run: error')
console.log(err)
});
async function run() {
Debug('run started...')
const thisWeek=AryThisWeek.getAryThisWeek(new Date());
Debug('thisWeek: '+thisWeek)
Debug('run done.')
}

View File

@ -0,0 +1,16 @@
{
"private": "true",
"name": "ary-this-week",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"dev": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Stefan Begerad",
"license": "GPL-3.0",
"devDependencies": {
"nodemon": "^2.0.7"
}
}