[chore] Refactoring and fixing jshint errors

real-time.js
- Refactored _saveCollectionTimes function
- split common code into separate _saveCollectionTime function

common.js
- Fixed jshint error with line break on &&