Created several javascript functions to handle sum, timestamp, etc