[JS] - Moved date activation into own function