Đã hoàn thành

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;


$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]

Kĩ năng: Drupal, PHP

Xem nhiều hơn: 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

Về Bên Thuê:
( 0 nhận xét ) Poland

ID dự án: #28380611

Được trao cho:


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 Thêm

€190 EUR trong 7 ngày
(1 Nhận xét)

8 freelancer chào giá trung bình€192 cho công việc này


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 Thêm

€174 EUR trong 2 ngày
(1059 Nhận xét)
(92 Nhận xét)

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 Thêm

€220 EUR trong 4 ngày
(74 Nhận xét)

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 Thêm

€200 EUR trong 3 ngày
(7 Nhận xét)

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 Thêm

€140 EUR trong 7 ngày
(10 Nhận xét)

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 Thêm

€140 EUR trong 7 ngày
(8 Nhận xét)

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 Thêm

€120 EUR trong 2 ngày
(0 Nhận xét)