Disclaimer
Honestly I'm just writing this so that I can require it without relative file paths in my projects.
If you find it useful, great. Otherwise, like all open-source software, expect zero support.
I will happily merge PRs though :)
API
// I recommend 'z' because 't' is a common temp var namevar z = timestamp = Date // Parse the timestamp in the timezone then output it in the moment-style format specified // Shorthandy goodness // Thu Jan 15// Uses 'ddd MMM D' as formatz // 6:05AM// Uses 'h:mmA' as formatz // 6:05AM 1/15/15z // Thu, Jan 15, 2015 6:05 AM// Uses preferred locale formatz // Thursdayz // 6 (integer)z // 5 (integer)z // Change the shorthand constantszconstantstimeFormat = 'h:mm a'
Is That All?
Yeah that's it. But seriously, if you had to do this hundreds of times, you would want something like this too.