-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.js
46 lines (43 loc) · 994 Bytes
/
a.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { getDay } from "date-fns";
/**
* Adding up
* @description Adds up two numbers
* @async
* @author Andreas Groos
* @param {number} one - first number
* @param {number[]} two -second number
* @returns {Array<number>} the sum of one and two
*/
export const sum = async (one, two) => {
// some async stuff
return (await one) + two;
};
/**
* Joins 2 arrays
*
* @param {number[]} arr1 first array is of numbers only!
* @param {string[]} arr2 second array contains only strings
* @returns {Array} joined array
*/
export function joinArr(arr1, arr2) {
return arr1.concat(arr2);
}
/**
* Returns the name of day in German
*
* @export dayInGerman
* @param {Date|String|Number} date - the given day
* @returns {String} the day of week in German language
*/
export function dayInGerman(date) {
const day = getDay(date);
switch (day) {
case 0:
return "Montag";
break;
case 1:
return "Dienstag";
default:
return "Sonntag";
}
}