Hotfix: Optimization and Bug Fixes
This commit is contained in:
parent
06d0d9c136
commit
4f3f8bd552
@ -36,10 +36,10 @@ function calculateAge(birthDateEntered) {
|
||||
const isValidDateFunction = isValidDate(birthDateDay + '/' + birthDateMonth + '/' + birthDateYear, currentDateObject.showDateTimeValue);
|
||||
|
||||
// Vérifie si la valeur entrée correspond à une date de naissance valide
|
||||
if(isValidDateFunction === true && !isNaN(ageDays)) {
|
||||
if(isValidDateFunction && !isNaN(ageDays)) {
|
||||
ageYears = formatNumberResult(ageYears);
|
||||
// Si c'est ton anniversaire aujourd'hui
|
||||
if(birthDateDay === day && parseInt(birthDateMonth) === month) {
|
||||
if(birthDateDay === day && birthDateMonth === month) {
|
||||
return 'Vous avez ' + ageYears + ' ans. Joyeux Anniversaire! 🥳';
|
||||
}
|
||||
else {
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { formatNumberResult } from '../fonctions_annexes/formatNumberResult_Function.js';
|
||||
|
||||
// Convertis des nombres de différentes bases et convertis en UTF-8. (source : http://jsfiddle.net/47zwb41o)
|
||||
/**
|
||||
* @function decimalToBinary
|
||||
|
@ -7,14 +7,14 @@
|
||||
* @example convertTemperature(23, '°C') → 23 °C = 73.4 °F
|
||||
*/
|
||||
function convertTemperature(degree, unit) {
|
||||
let temperatureValue = 0;
|
||||
if (unit === "°C") {
|
||||
const temperatureValue = ((degree * 9/5) + 32) + " °F";
|
||||
return degree + " " + unit + " = " + temperatureValue;
|
||||
temperatureValue = (((degree * 9/5) + 32) + " °F");
|
||||
}
|
||||
else if (unit === "°F") {
|
||||
const temperatureValue = (degree - 32) * 5/9 + " °C";
|
||||
return degree + " " + unit + " = " + temperatureValue;
|
||||
temperatureValue = ((degree - 32) * 5/9 + " °C");
|
||||
}
|
||||
return `${degree} ${unit} = ${temperatureValue}`;
|
||||
}
|
||||
|
||||
/* Exports */
|
||||
|
Reference in New Issue
Block a user