Update DateTime.js

cleaned the code by updating deviceType mapping to local variable inside function.