1

I have created a View and added a filed Date. This Field have 4 type of Formatter

1) Date and Time 2) Time Ago 3) plain 4) Services Raw

If I select First it give HTML tags in output and if select 3rd or 4th it give output like these numbers "1439393400"

I need the simple date in output without any HTML tags. Please tell me how I can get rid of HTML tags if I select first option. If its not possible then how I can convert the output which I get from Plain Formatter so that I get simple date not these number.

1

For creating a new date format to be used in views:-

Go to yoursite.com/admin/config/regional/date-time And create the new format.

Now, Go to the view you're working on, add date field, change its format. Yes, it's as simple as that.

Plus: You can use Date module, it has got amazing features.

0

In Drupal 7, when editing the view, you can click on the 'Advanced' link which will bring up a list of more advanced options for that view. There will be a 'Theme Information' link in that list that when clicked, will inform you of all the various template files that are being used and that can be created to override output from the view.

You can get as granular as the output of the field data itself by creating the recommended field level tpl.php file and performing the modifications you'd like for output.

0

Steps to get the just the year for Delivery Date field

  • Navigate to /admin/config/regional/date-time/formats page.
  • Click on Add Format button (/admin/config/regional/date-time/formats/add)
  • In the Format string text field add Y and save it.
  • Now add a date type by navigating to /admin/config/regional/date-time page.
  • Add a new date type and use the the format that we have added in the previous steps.
  • In the view select the type you want the date to be rendered.

enter image description here

So instead of Rewriting the output, you would directly get the year.

Hope that this will help you.

0

For date format, select Custom

enter image description here

For custom date format, if you put

enter image description here

d/m/y will result in 23/04/16

M j, Y will result in April 23, 2016

etc.. see the php date manual for all replacement characters


Please tell me how I can get rid of HTML tags if I select first option

If you're referring to div wrappers

enter image description here

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.