Home > views > Use custom datetime format in view (both created in code)

Use custom datetime format in view (both created in code)

October 18Hits:3
Advertisement

I have a view displaying a date field (from the Date module). I only want it to show hh:mm though, so I created a new datetime format.
This worked fine until I moved it into my module, i.e. I create it via hook_data_format_types and hook_date_formats. The view is also created by the module (via Features).

Now my problem is that after enabling the module, the view uses the default datetime format. After saving the date/time formats (without performing any modifications) it works fine though so it smells like some caching issue.

I wonder how to make it work without this step as having to do anything but enabling the module, especially when unrelated to what the module does, is not very user-friendly.

Tags:date, views

Related Articles

  • Use custom datetime format in view (both created in code)October 18

    I have a view displaying a date field (from the Date module). I only want it to show hh:mm though, so I created a new datetime format. This worked fine until I moved it into my module, i.e. I create it via hook_data_format_types and hook_date_formats

  • Inserting day of the week into custom datetime format

    Inserting day of the week into custom datetime formatJuly 6

    I'm using a custom datetime format and a custom environment to generate a list of dates (for a course syllabus), and would like to modify it a bit more to add the abbreviated day name after the numerical date. Here's what I have: \documentclass{artic

  • Custom datetime format from DB in JMSSerializerBundle

    Custom datetime format from DB in JMSSerializerBundleFebruary 3

    I have a simple problem but I have no idea how to solve it. I have a project in Symfony2 with FOSRestBundle + JMSSerializerBundle. In my entities, I've got some datetime fields, and the user should be able to define the format of the datetime retriev

  • Why using of custom date format makes my Drupal date outdated and does not change at all?April 29

    I have custom installation profile and I must set date formats programmatically. I tried: db_insert('date_formats') ->fields(array( 'format' => $format_long, // PHP Date String 'type' => 'custom', // 'custom' 'locked' => 0, // 0 = user-specifi

  • How do I create a custom date format in footer that updates automatically in Powerpoint 2007?December 23

    I see how to add a date to the footer that updates automatically, either via "Insert->Header&Footer" or "Insert->Date&Time". Works great! However, I can't figure out how to do this with a custom date format (for example,

  • Creating a custom binary format for 3D meshesJanuary 27

    I've seen people saying it's better and faster to use a custom binary format for your 3D models, based on your needs, instead of using exchange formats. But, I'd like to know how to create a basic format, that contains just vertex and index data, how

  • Views date field does not follow custom date format

    Views date field does not follow custom date formatFebruary 21

    I have a custom date format defined (via code), and this is what I see in the administration pages: In views, I've attached a field, and trying to use a formatter, but they're all showing up like this: I can't seem to select my m/d/y feature, and eve

  • Drupal: How to create a custom exposed filter in views 3 in Drupal 7March 27

    I try to create a custom exposed filter in views 3 of Drupal 7 Where can I learn about how to create a custom exposed filter for Views 3 and D7? Someone put some code example in the URL above, but it seems it is in views 2!? Does any one know how to

  • How to create a custom markup for a views-block?June 30

    I'm trying to understand the templating system of Drupal 8, allready did some basic stuff. My next step is trying to create a template to mark up a list generated by a view. Here's what I've done so far: I created: A Content Type, with 3 fields: Titl

  • How to format datetime in Edit view & details view in Sugarcrm?

    How to format datetime in Edit view & details view in Sugarcrm?January 15

    How to format datetime in Edit view & detail view in Sugarcrm? I want to standardize the datetime format in one or more modules. I tried some changes in customCode, but not working. Thanks.

  • Can I create a custom interface to power views search?March 19

    My content is well structured from an internal point of view, but I want to provide a more customer-focussed front-end to an advanced search form. e.g. I want to offer a list of check boxes like Show: [ ] All [X] Articles [X] Yellow things [ ] Super

  • Google Sheets Customize View Using Create Custom Menu and Hiding/Showing Specifc Columns

    Google Sheets Customize View Using Create Custom Menu and Hiding/Showing Specifc ColumnsAugust 22

    Trying to determine a way that I can use a custom menu (.createMenu) with views that will allow me to show / hide specific columns. I need the capability to pick specific multiple columns and not ranges. In the example below how can you pick a custom

  • Custom Date Format in MS Word 2010

    Custom Date Format in MS Word 2010September 1

    I have a date field in a Word document which was created from a template included with Microsoft Word 2010. The default setting for this field is to display only two places of the current year. I would like to change it to display the complete year n

  • Custom Date Format Not Available to my Date FieldAugust 15

    I'm sure I'm missing something super simple, but for some reason, my date field that I've created cannot make use of the "custom format" option in Views. I'm using D7 7.22 and the Date Module, 7.x.2.6 I've noticed that the field that I created i

  • Change Datetime formatMarch 21

    I'm using Gnome 3 / Gnome-shell, and Ubuntu 13.10. I'd like to display the timestamp (as in, the number of seconds since 1970/01/01 00:00 UTC) next to the clock in the top bar. I figured out I just needed to change the time format and add a %s. Then

  • What is best and easiest way Custom list formatting in SharePoint 2013?January 9

    There are several ways for custom list formatting in SharePoint 2013? What is best and easiest way to format a Custom list in SharePoint 2013? --------------Solutions------------- You can use JSLinks to format your custom list. Using JSLink create a

  • How to convert date format on view?

    How to convert date format on view?June 19

    I have created a View. Its display format is grid.One of field is Time. It is displayed as "Time: 1300". I need to get it printed as "Time: 1:00 pm". I am using Room Reservations module and in my reservations tab time is displayed. Can

  • Android Custom datetime picker disable dates before today's date

    Android Custom datetime picker disable dates before today's dateFebruary 10

    I have created this Custom DialogFragment to picker Date and time but i dont know how to disable dates before today's date as well as show only 7 days Ex. if todays 10 feb then disable all date before 10 feb and only show dates 10,11,12,14,15,16,17 f

  • Custom Post Formats for Custom Post TypesOctober 30

    The weight of opinion seems to favour using custom post types instead of custom post formats. I have several custom post types that I want to style in 4 different formats in a way that is not public ie not a category, tag or custom taxonomy. Custom p

  • How to implement a custom field available for Views?February 1

    I'm making my first steps authoring simple modules. I would like to make my life easier by implementing a custom field for taxonomy views, a field named: "Taxonomy term: Arbitrary ascendant" so that it gets a term's ascendant at the given hierar

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 1.262 s.