Skip to content

Instantly share code, notes, and snippets.

View Meldiron's full-sized avatar
🔥

Matej Bačo Meldiron

🔥
View GitHub Profile
@Meldiron
Meldiron / app.ts
Last active August 1, 2021 11:01
Typescript: Get current weekdays
// v1.0.1
// consts
const weekInMs = 1000 * 60 * 60 * 24 * 7;
const dayInMs = 1000 * 60 * 60 * 24;
// main function
const getWeekArray = (currentDate: Date, page: number) => {
if (page > 0) {
currentDate = new Date(currentDate.getTime() + weekInMs * page); // Add X weeks where X is page
x-swagger-router-controller: products_ctrl
get:
tags:
- Catalog
summary: Get products object
description: You can filter list by currency, category and language
operationId: searchProducts
parameters:
- name: lang_id
in: query
CREATE TABLE phonebook (
phone VARCHAR(20) NOT NULL,
fname VARCHAR(50) NOT NULL,
lname VARCHAR(50) NOT NULL,
email VARCHAR(100),
state VARCHAR(50) NOT NULL,
city VARCHAR(50),
age INT
);
let pubAPI; //je nastavene v momente ked sa logne po FB, je to nastavene zasadne pred tym ako je vyvolane changeTitle()
let dbDays; //je nastavene pred changeTitle, precita hodnotu z DB..
function changeTitle() {
if(pubAPI) {
let date1 = new Date();
var date2 = new Date("2018-06-29 00:00:00");
var timeDiff = Math.abs(date2.getTime() - date1.getTime());