I have created a block entity using bean module.
It has three image fields. Image1, Image2 and Image3.
I want to show only one image depending upon current time. I have three time values. For this I have created 3 view modes each for one time value.
Now I'm stuck that how will change the view mode based on time value programmatically.
I have used the following code.
function glue_site_block_view_alter(&$data, $block) {
if ($timevalue1 == $value1) {
$data['content']['bean']['block_delta']['#view_mode'] = 'view_mode1'
}