Skip to content

Commit

Permalink
Merge pull request Countly#7 in MS/countly-server from feature/publis…
Browse files Browse the repository at this point in the history
…h_events to master

* commit 'e47fd0699beb92e0d9df5e9d5611ff76c873861b':
  split table based on CN time
  • Loading branch information
Yong Li committed Aug 21, 2019
2 parents 0a43fd1 + e47fd06 commit 0ce7724
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/parts/data/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ function saveEventRawData(base_data, event) {

// get current date (UTC), format: YYYYMMDD
var today = new Date();
var date_suffix = today.toISOString().split('T')[0].replace(/-/g,'');
var options = {timeZone: 'Asia/Shanghai', year: 'numeric', month:'2-digit', day: '2-digit'}
var date_suffix = today.toLocaleDateString('zh-CN', options).replace(/\//g,'');

var db_collection_name = "events_raw_" + table_suffix + '_' + date_suffix; //table name: 'events_raw_<app_id>_<date:YYYYMMDD>'
base_data._id = new ObjectID();
Expand Down

0 comments on commit 0ce7724

Please sign in to comment.