Drupal - How can I get form creation date? - drupal

I created some content type, and they have a start date field and an end date field, like this:
enter image description here
These 2 Fields have being to used in various content types. I got the creation date of the content type using $date_form_created = $form_state->getValue('created')[0]['value'].
Debugging the code I find the following:
enter image description here
In some content types, $date_form_created is null, and I don't know why.
I need the date and time of the creation of the content type. Any idea how I could resolve this?

Related

Is there a way to reference data contained in fields on related record using formula field?

I want to display the taxcode custom field on invoice records
According to Netsuite Help, the format for the formula would be like that:
{taxcode.customfieldid}, knowing that (taxcode is the field id for the taxcode field on the lines of invoice record. customfieldid is the field id for the custom field on the TaxCode record)
PS: customfieldid is a free-text
I have tried possibilities like:
{invoice.item.taxcode.customfieldid}
{item.taxcode.customfieldid}
But I still get this error "ERROR: Field 'taxcode.customfieldid' Not Found"
how can I fix this? Can anyone provide some guidance on this issue?
Generally Netsuite will only look one level away from the record you are on.
In your case you should create a new transaction line field (say custcol_tax_extra) and source that from the taxcode so when a tax code is selected that value is pulled up onto the line.
Then your xml:
<#list record.item as item>${item.custcol_tax_extra}...

Drupal 7 Wrong Timestamp showing up in a custom view instead of what is there in the database table

I have a view created in a drupal 7 to display the data fields from a table in the database and one of the fields is date_entered which is a timestamp. But the data in the timestamp field shows up as same for each record as " 1969/12/31 - 19:33" instead of what's there in the table.
I have tried changing the timestamp format and applying a patch to fix the issue but nothing seems to fix this.
Do u use the date module? It solves all date and timestamp issues.
Found a work around, i created a hidden field using date module and used the default site format to populate the hidden field and used the array while doing the submit db insert which in turn populates the data base table with the current date of submission and used that date field in the view to display the date instead of the complete timestamp.

Crystal Reports: How do I change datetime format to date?

In one report under database fields in the Field Explorer the field type says "DATE"
When I try to build a new report, the same field is datetime.
Can someone tell me how to change this to date? The end goal is to use Date, from the field Batch.ClosingTime in the select expert.
I've attached screen grabs from the two different reports, the one on the left is how I would like it to look.

Wordpress Post Date, shows month by number and text

I am having troubles with my Worpress post date. As the picture shows, I can publish the post with 01-Jan etc. I only want to post the month with text, and no numbers. Any suggestions?
You mentioned in the comments that the date on the front end was displayed wrong. Therefore, I suggest you look at the PHP source that is creating that page.
It's possible that the date format has been explicitly set in there, especially if you are using a non-custom theme, so the format under 'Settings -> General' could be ignored.

How can I set a schema.Datetime field to None with Dexterity

I'm writing a simple content type with Dexterity to manage customers, beside the usuals fields, eg name, company, phone...
I've also added a Datetime field to store when the first meeting with
customers has been held, lets call it 'firstmeeting', which I defined
in my interface ICustomers as:
firstmeeting = schema.Datetime(
title=_(u"First Meeting"),
required=False,
)
Now, I notice that when I saved a new Customer document the firstmeeting
field has been filled with the current date even if I don't set any date
in the form, which is not what I want because no meeting with the
customer has been held yet. So I'd like to know how to set a None value
for this field so nothing will be displayed.
I've been trying to use a custom class has explained by Martin Aspeli in
http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/classes
but I don't know how to check the user input and set None value if nothing
was typed in.
Thanks
Have you tried default=None?
I found out what was happening in my code.
Actually the problem was in the template view.pt where I used toLocalizedTime() function,
which was converting the None value to the current date, so I added a tal:condition to print the date value.
<span id="form-widgets-firstmeeting" class="datetime-widget datetime-field"
tal:condition="context/firstmeeting"
tal:content="python:context.toLocalizedTime(context.firstmeeting)" />

Resources