timestamp.js 632 B

12345678910111213141516171819
  1. /*
  2. Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. if(!dojo._hasResource["dojox.cometd.timestamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
  7. dojo._hasResource["dojox.cometd.timestamp"] = true;
  8. dojo.provide("dojox.cometd.timestamp");
  9. dojo.require("dojox.cometd._base");
  10. // A cometd extension that adds a timestamp to every message
  11. dojox.cometd._extendOutList.push(function(msg){
  12. msg.timestamp = new Date().toUTCString();
  13. return msg
  14. });
  15. }