Created
November 5, 2015 13:11
-
-
Save mcelotti/a3f8a6a752b0a5e41ae1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('Ext.ux.TimestampIdentifier', { | |
alias : 'data.identifier.timestamp', | |
config : { | |
negative : false, | |
string : true | |
}, | |
constructor : function(config) { | |
this.initConfig(config); | |
}, | |
generate : function() { | |
var ts = new Date().getTime(); | |
if (this._negative) { | |
ts = -Math.abs(ts); | |
} | |
if (this._string) { | |
return String(ts); | |
} else { | |
return ts; | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ext.ux.TimestampIdentifier
Usage: