main-project/app/client/src/Actions/utility.js
/*
  Specific function for stripping the date from a JS Date object
  & returnign a String in the specific YYYY-MM-DD format.

  This only exists, because Chrome is especially picky about the format used by
  input JSX objects of type "date".
 */
Specific function for stripping the date from a JS Date object
& returnign a String in the specific YYYY-MM-DD format.

This only exists, because Chrome is especially picky about the format used by
input JSX objects of type "date".
Specific function for stripping the date from a JS Date object & returnign a String in the specific YYYY - MM - DD format . This only exists because Chrome is especially picky about the format used by input JSX objects of type " date " .
function genUniversalDate(date) {
  try {
    const y = date.getFullYear();
    let m = `${date.getMonth() + 1}`;
    if (m.length < 2) m = "0" + m;
    let d = `${date.getDate()}`;
    if (d.length < 2) d = "0" + d;
    return `${y}-${m}-${d}`;
  } catch (e) {
    return "";
  }
}
function genUniversalDate ( date ) { try { const y = date . getFullYear ( ) ; let m = ` ${ date . getMonth ( ) + 1 } ` ; if ( m . length < 2 ) m = "0" + m ; let d = ` ${ date . getDate ( ) } ` ; if ( d . length < 2 ) d = "0" + d ; return ` ${ y } ${ m } ${ d } ` ; } catch ( e ) { return "" ; } }
Specific function for stripping the date from a JS Date object
& returnign a String in the specific YYYY-MM-DD format.
Specific function for stripping the date from a JS Date object & returnign a String in the specific YYYY - MM - DD format .