Completed

Drupal 7 - time and date field to integer and a view summary

1) I need code in PHP for drupal computed field ([login to view URL]) that would calculate difference in days between two dates e.g. :

date 1: 1st may 2019

date 2: 20 July 2020

date 2 - date 1 = circa 365 + 80 days = 445 days

and provide it as an integer value as a number of years, that I could further use for extra calculations.

445 days (calculated difference) / 365 (average year) = 1.219

that number (difference in days as a number of years) should be the output of the code.

2) some values would be provided as char or string. The code should account for it.

A draft version of the code:

$value1_energy1 = field_get_items($entity_type, $entity, 'field_energy1');

$value2_energy2 = field_get_items($entity_type, $entity, 'field_energy2');

if ($value2_energy2[0]['value'] > '0') {

$entity_field[0]['value'] = $value2_energy2[0]['value']*0.000351 + $value1_energy1 [0]['value']*0.000812;

}else{

$entity_field[0]['value'] = $value1_energy1[0]['value']*0.000812;

}

This is just a basic calculation and:

a) there is no date field included

b) valued1 and value2 could be provided as a string (and have a space or a comma instead of a dot).

3) those calculated values shoud be summed up in a view

There is a view with a list of nodes, and at the bottom of the view we need to provide a sum of those calculated values

example of the view with fomulas:

[login to view URL]

Skills: Drupal, PHP

See more: sample adobe form current date time form field, drupal date field content type, drupal import cck date field, drupal 7 field template, drupal 7 file field paths module, drupal 7 field encrypt, drupal 8 date field timezone, drupal 7 date time, download view module drupal 7, drupal 7 checkbox field, create view from custom table drupal 7, editable view drupal 7, drupal 7.60 release date, drupal 7 form api hidden field, drupal 7 image field, drupal 8.7 release date, view export drupal 7, drupal 7 content type field node reference, drupal 7 video embed field

About the Employer:
( 0 reviews ) Poland

Project ID: #28380611

Awarded to:

Ggov

I have the following experience with Drupal and PHP Experience developing web solutions in Drupal and PHP implementations in a LAMP environment. Advanced site-building experience including deep familiarity with Drupal More

€190 EUR in 7 days
(1 Review)
4.4

8 freelancers are bidding on average €192 for this job

sapotacorp

Hello sir, I check [login to view URL] carefully and I am absolutely sure that I can do the project very well. We are enthusiastic team of developer a complete package for the successful exec More

€174 EUR in 2 days
(1059 Reviews)
9.0
(92 Reviews)
7.6
schoudhary1553

Hi, Greetings! ✅checked your project details: Drupal 7 - time and date field to integer and a view summary ✅Completed Time: In project deadline We have worked on 640 + Projects. I have 6 + years of the experien More

€220 EUR in 4 days
(74 Reviews)
6.6
Nehag510

Hello, Warm Greetings! I have gone through your job description & I completely understand that you need a highly skilled Drupal developer with strong coding and troubleshooting skill. I am a Senior Drupal front-end More

€200 EUR in 3 days
(7 Reviews)
4.9
vpsbohra

Hello, Let's have a quick discussion to start work right away. Here a professional Drupal 7 developer with 7 years of experience and proficient in all aspects having both frontend/backend Drupal development Also, I c More

€140 EUR in 7 days
(10 Reviews)
3.6
Pluton1

Hi there, I have read your requirements i can give you code in PHP for Durpal computed field and complete your project as all the requirement written in the bid and submit it to you in your given deadline after chat in More

€140 EUR in 7 days
(8 Reviews)
3.9
kingqueen369

Hi, Greetings! ✅checked your project details :Drupal 7 - time and date field to integer and a view summary ✅Completed Time : 24 hours or your requirement deadline . I would like to work on your project and want to be More

€120 EUR in 2 days
(0 Reviews)
0.0