daily pastebin goal
8%
SHARE
TWEET

EasyDateConverter

a guest Dec 11th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class EasyDateConverter {
  2.     static getNumberFromString(serverResponseString) {
  3.         return parseInt(serverResponseString.replace(/\D+/g, ""));
  4.     }
  5.  
  6.     static getDateFromServerResponse(serverResponseString) {
  7.         return new Date(EasyDateConverter.getNumberFromString(serverResponseString));
  8.     }
  9.  
  10.     static getStringDateFromServerResponse(serverResponseString) {
  11.         return EasyDateConverter.getDateFromServerResponse(serverResponseString).toLocaleDateString();
  12.     }
  13. };
  14.  
  15. //<Строка фикса бага с минус днем>
  16. var stringDate = EasyDateConverter.getStringDateFromServerResponse(data[keyVar]);
  17. //</Строка фикса бага с минус днем>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top