Compare commits

...

3 Commits
1.6.1 ... 1.6.2

Author SHA1 Message Date
d8fd12a7b9 v1.6.2 2020-02-24 16:27:18 +00:00
88b5ce3d2e Merge branch 'master' of github.com:hoegrammer/opencase 2020-02-24 13:01:15 +00:00
c63cae6b71 Added callback to default to current date
But it isn't displaying, possibly because of having the wrong kind of widget
2020-02-23 17:36:48 +00:00
3 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,15 @@
<?php
function opencase_entities_update_8013() {
$update_manager = \Drupal::entityDefinitionUpdateManager();
$definition = $update_manager->getFieldStorageDefinition('activity_date_time', 'oc_activity');
// $definition->setDescription('');
// $definition->setRequired('');
//->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
$update_manager->updateFieldStorageDefinition($definition);
}
/**
* Add 'activity_date_time' field to 'oc_activity' entities.
*/

View File

@ -86,7 +86,6 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
public static function currentDateTime() {
$current_time = DrupalDateTime::createFromTimestamp(time());
$formatted = $current_time->format(DateTimeItem::DATETIME_STORAGE_FORMAT);
\Drupal::logger("nr_debug")->notice($formatted);
return $formatted;
}
/**

View File

@ -2,7 +2,7 @@ name: 'OpenCase'
type: module
description: 'Simple Case Management'
core: 8.x
version: 8.x-1.6
version: 8.x-1.6.1
package: 'OpenCase'
dependencies:
- opencase_entities