Skip to content

Commit

Permalink
move toggleFullScreen to DOM and only export getDate from getDate file
Browse files Browse the repository at this point in the history
  • Loading branch information
201flaviosilva committed Oct 14, 2022
1 parent b13f0ee commit 2c0e9f8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jsdoc.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"menu": [
{
"title": "GitHub",
"link": "https://github.com/201flaviosilva/javascript-utils/",
"link": "https://github.com/201flaviosilva-labs/javascript-utils/",
"target": "_blank"
}
]
Expand Down
2 changes: 2 additions & 0 deletions src/DOM/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { KeyboardManager, KeyboardManagerInstance, KEYS } from "./KeyboardManage
import { MouseManager, MouseManagerInstance, MouseButton } from "./MouseManager.js";
import { notification } from "./notification.js";
import { printObjectInDOM } from "./printObjectInDOM.js";
import { toggleFullScreen } from "./toggleFullScreen.js";

/**
* Utils for DOM
Expand All @@ -16,4 +17,5 @@ export {
MouseManager, MouseManagerInstance, MouseButton,
notification,
printObjectInDOM,
toggleFullScreen,
};
3 changes: 3 additions & 0 deletions src/toggleFullScreen.js → src/DOM/toggleFullScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*
* @param {HTMLElement} element - the DOM element to put in full screen
* @returns {void}
*
* @function toggleFullScreen
* @memberof DOM
*/
export function toggleFullScreen(element = document.documentElement) {
if (!document.fullscreenElement) element.requestFullscreen();
Expand Down
37 changes: 37 additions & 0 deletions src/getDate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
/**
* Returns the date
* @see {@link https://www.w3schools.com/jsref/jsref_obj_date.asp}
*
* @example
* getDate() // {
time: 1653573577063,
milliseconds: 134,
seconds: 24,
minutes: 24,
hours: 15,
day: 31,
weekDay: 7,
week: 50,
month: 5,
year: 2022,
dateFormatted: "1/1/2021",
}
*
* @returns {Object}
*/
export function getDate() {
return {
time: getTime(),
milliseconds: getMilliseconds(),
seconds: getSeconds(),
minutes: getMinutes(),
hours: getHours(),
day: getDay(),
weekDay: getWeekDay(),
week: getWeek(),
month: getMonth(),
year: getYear(),
dateFormatted: getDateFormatted(),
}
}

/**
* Returns the number of milliseconds since midnight Jan 1 1970, and a specified date
* @see {@link https://www.w3schools.com/jsref/jsref_obj_date.asp}
Expand Down
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { divideEvenly } from "./divideEvenly.js";
import { EventSystem, EventSystemInstance } from "./EventSystem.js";
import { Fibonacci, fibonacciSequence, fibonacciUntil, fibonacciCustomSequence, recursiveFibonacci } from "./Fibonacci.js";
import { FIFO } from "./FIFO.js";
import { getTime, getMilliseconds, getSeconds, getMinutes, getHours, getDay, getWeekDay, getWeek, getMonth, getYear, getDateFormatted } from "./getDate.js";
import { getDate } from "./getDate.js"; // import { getTime, getMilliseconds, getSeconds, getMinutes, getHours, getDay, getWeekDay, getWeek, getMonth, getYear, getDateFormatted } from "./getDate.js";
import { getPositionWithAngleDistance } from "./getPositionWithAngleDistance.js";
import { getUrlParameter } from "./getUrlParameter.js";
import { getVersion } from "./getVersion.js";
Expand Down Expand Up @@ -62,7 +62,6 @@ import { stringToScreamingSnakeCase, screamingSnakeCaseToNormal } from "./scream
import { stringToSnakeCase, snakeCaseToNormal } from "./snakeCase.js";
import { subtraction } from "./subtraction.js";
import { sum } from "./sum.js";
import { toggleFullScreen } from "./toggleFullScreen.js";
import { topDownCarMovimentation } from "./topDownCarMovimentation.js";
import { Vector2 } from "./Vector2.js";
import { xnor } from "./xnor.js";
Expand Down Expand Up @@ -99,7 +98,7 @@ export {
EventSystem, EventSystemInstance,
Fibonacci, fibonacciSequence, fibonacciUntil, fibonacciCustomSequence, recursiveFibonacci,
FIFO,
getTime, getMilliseconds, getSeconds, getMinutes, getHours, getDay, getWeekDay, getWeek, getMonth, getYear, getDateFormatted,
getDate, // getTime, getMilliseconds, getSeconds, getMinutes, getHours, getDay, getWeekDay, getWeek, getMonth, getYear, getDateFormatted,
getPositionWithAngleDistance,
getUrlParameter,
getVersion,
Expand Down Expand Up @@ -131,7 +130,6 @@ export {
stringToSnakeCase, snakeCaseToNormal,
subtraction,
sum,
toggleFullScreen,
topDownCarMovimentation,
Vector2,
xnor,
Expand Down

0 comments on commit 2c0e9f8

Please sign in to comment.