aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/tests/utils/miscs.js
blob: 4ceff65df5cb09e4bf316979bbc04ac6a1114cae (plain) (tree)
1
2
3
4


                    
             
















                                                                              
'use strict'

const miscsUtils = {
  dateIsValid
}

// ---------------------- Export functions --------------------

function dateIsValid (dateString) {
  const dateToCheck = new Date(dateString)
  const now = new Date()

  // Check if the interval is more than 2 minutes
  if (now - dateToCheck > 120000) return false

  return true
}

// ---------------------------------------------------------------------------

module.exports = miscsUtils