old_contents: Astro.Behavior.create({
    name: 'timestamp',
    methods: {
      setCreationDate: function(doc) {
        let Class = doc.constructor;
  
        // Find a class on which the behavior had been set.
        let classBehavior = Class.getBehavior('timestamp');
        let options = classBehavior.options;
  
        // Get current date.
        let date = new Date();
  
        // If the "hasCreatedField" option is set.
        if (options.hasCreatedField) {
          // Set value for created field.
          doc[options.createdFieldName] = date;
        }
  
        if (options.hasUpdatedField) {
          // Set value for the "updatedAt" field.
          doc[options.updatedFieldName] = date;
        }
      },
      setModificationDate: function(doc) {
        let Class = doc.constructor;
  
        // Find a class on which the behavior had been set.
        let classBehavior = Class.getBehavior('timestamp');
        let options = classBehavior.options;
  
        // Get current date.
        let date = new Date();
  
        // If the "hasUpdatedField" option is set.
        if (options.hasUpdatedField) {
          // Set value for the "updatedAt" field.
          doc[options.updatedFieldName] = date;
        }
      }
    },
    options: {
      hasCreatedField: true,
      createdFieldName: 'createdAt',
      hasUpdatedField: true,
      updatedFieldName: 'updatedAt'
    },
    createSchemaDefinition: function(options) {
      var schemaDefinition = {
        fields: {},
        events: events
      };
  
      if (options.hasCreatedField) {
        // Add a field for storing a creation date.
        schemaDefinition.fields[options.createdFieldName] = {
          type: Date,
          immutable: true,
          default: null
        };
      }
  
      if (options.hasUpdatedField) {
        // Add a field for storing an update date.
        schemaDefinition.fields[options.updatedFieldName] = {
          type: Date,
          optional: true,
          default: null
        };
      }
  
      return schemaDefinition;
    }
  });
  
new_contents: Astro.Behavior.create({
  	name: 'timestamp',
  	options: {
  		hasCreatedField: true,
  		createdFieldName: 'createdAt',
  		hasUpdatedField: true,
  		updatedFieldName: 'updatedAt'
  	},
  	createClassDefinition: function() {
  		let behavior = this;
  
  		let definition = {
  			fields: {},
  			events: {
  				beforeInsert: function timestampBeforeInsert(e) {
  					var doc = e.currentTarget;
  					var Class = doc.constructor;
  					behavior.setCreationDate(doc);
  				},
  				beforeUpdate: function timestampBeforeUpdate(e) {
  					var doc = e.currentTarget;
  					var Class = doc.constructor;
  					behavior.setModificationDate(doc);
  				}
  			}
  		};
  
  		if (this.options.hasCreatedField) {
  			// Add a field for storing a creation date.
  			definition.fields[this.options.createdFieldName] = {
  				type: Date,
  				immutable: true,
  				default: null
  			};
  		}
  
  		if (this.options.hasUpdatedField) {
  			// Add a field for storing an update date.
  			definition.fields[this.options.updatedFieldName] = {
  				type: Date,
  				optional: true,
  				default: null
  			};
  		}
  
  		return definition;
  	},
  	setCreationDate: function(doc) {
  		// Get current date.
  		let date = new Date();
  
  		// If the "hasCreatedField" option is set.
  		if (this.options.hasCreatedField) {
  			// Set value for created field.
  			doc[this.options.createdFieldName] = date;
  		}
  
  		if (this.options.hasUpdatedField) {
  			// Set value for the "updatedAt" field.
  			doc[this.options.updatedFieldName] = date;
  		}
  	},
  	setModificationDate: function(doc) {
  		// Get current date.
  		let date = new Date();
  
  		// If the "hasUpdatedField" option is set.
  		if (this.options.hasUpdatedField) {
  			// Set value for the "updatedAt" field.
  			doc[this.options.updatedFieldName] = date;
  		}
  	}
  });
subject: Update behavior to work with a new behaviors system