Files
plantes/src/index.js
2022-01-14 16:52:43 +01:00

24 lines
646 B
JavaScript

import App from './components/App';
import './style';
Number.prototype.pad = function(n) {
return (new Array(n).join('0') + this).slice(-n)
}
Date.prototype.addDays = function (days) {
let date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
}
Date.prototype.toFrDate = function() {
let month = ((this.getMonth() + 1 < 10) ? '0' : '') + (this.getMonth() + 1)
return `${this.getDate()}/${month}/${this.getFullYear()}`
}
Date.prototype.toSQLDate = function() {
return `${this.getFullYear()}-${Number(this.getMonth() + 1).pad(2)}-${Number(this.getDate()).pad(2)}`
}
export default App;