Skip to content

Instantly share code, notes, and snippets.

View jazzcelaya's full-sized avatar

Jazmin Celaya jazzcelaya

View GitHub Profile
@jazzcelaya
jazzcelaya / README.md
Created October 21, 2021 08:20 — forked from cvillanueva84/README.md
Mini-Challenge 1: Core Concepts and Styling

Mini-Challenge 1: Core Concepts and Styling

Before you start:

  1. Read carefully the instructions for the project, please make sure that you clearly understand all the requirements.
  2. Fork this repo. Please make sure that your new repo is publicly accesible.

NOTE: You should use the provided codebase only as a guide for structuring your application. Feel free to add, remove, or change anything if you consider it necessary.

The challenge:

  1. Create the UI layout for your app, it should include the following elements:
@jazzcelaya
jazzcelaya / weekNumber.js
Created February 25, 2021 21:11
Week number of the year with JS (Starting on Sundays)
Date.prototype.getWeekStartingOnSunday = function() {
var date = new Date(this.getTime());
// Thursday in current week decides the year.
// offset +1 because the week starts on Sunday
date.setDate(date.getDate() + 4 - (date.getDay()+1 + 6) % 7);
// January 4 is always in week 1.
var week1 = new Date(date.getFullYear(), 0, 4);
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000
- 4 + (week1.getDay()+1 + 6) % 7) / 7);
}