<commit_before>'use strict';

angular.module('Teem')
  .factory('ProjectsSvc', [
  'swellRT', '$q', '$timeout', 'base64', 'SessionSvc', 'SwellRTCommon', 'User',
  '$rootScope', 'Logo', 'Url', 'Participation',
  function(swellRT, $q, $timeout, base64, SessionSvc, SwellRTCommon, User,
  $rootScope, Logo, Url, Participation){

    // class that expose only read methods of the project object
    class ProjectReadOnly extends aggregation(Object, Logo, Url, Participation.ReadOnly) {

      // val is a readOnly object from a SwellRT query result
      constructor (val) {
        // calling "this" is not allowed before super()
        super();

        if (val) {
          for (var k in val.root){
            if (val.root.hasOwnProperty(k)){
              this[k] = val.root[k];
            }
          }
          this._participants = val.participants;
          if (val._id && val._id.$oid){
            this._creationDate =
              parseInt(val._id.$oid.slice(0, 8), 16) * 1000;
            } else {
              this.creationDate = 0;
            }
        }
      }
<commit_msg>fix cretion date setting at startup when no _id from query is present<commit_after>'use strict';

angular.module('Teem')
  .factory('ProjectsSvc', [
  'swellRT', '$q', '$timeout', 'base64', 'SessionSvc', 'SwellRTCommon', 'User',
  '$rootScope', 'Logo', 'Url', 'Participation',
  function(swellRT, $q, $timeout, base64, SessionSvc, SwellRTCommon, User,
  $rootScope, Logo, Url, Participation){

    // class that expose only read methods of the project object
    class ProjectReadOnly extends aggregation(Object, Logo, Url, Participation.ReadOnly) {

      // val is a readOnly object from a SwellRT query result
      constructor (val) {
        // calling "this" is not allowed before super()
        super();

        if (val) {
          for (var k in val.root){
            if (val.root.hasOwnProperty(k)){
              this[k] = val.root[k];
            }
          }
          this._participants = val.participants;
          if (val._id && val._id.$oid){
            this._creationDate =
              parseInt(val._id.$oid.slice(0, 8), 16) * 1000;
            } else {
              this._creationDate = 0;
            }
        }
      }

{'fraction_non_alphanumeric': 0.13386880856760375, 'fraction_numerical': 0.011601963409192326, 'mean_word_length': 2.1982881597717547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6868809', 'n_tokens_mistral': 704, 'n_tokens_neox': 671, 'n_words': 186}