datetime tools into own file. remove ajax duplication