• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
[TH] Date Field for Custom Fields (Custom Field XML)

[TH] Date Field for Custom Fields (Custom Field XML) 1.0.0a

No permission to download

Jon W

Well-known member
#1
Waindigo submitted a new resource:

Date Field for Custom Fields by Waindigo (Custom Field XML) - Add date fields to your threads, posts, resources or user profile.

This is a date custom field.

This has been posted as an example of what can be achieved using the latest version of the Custom Fields by Waindigo add-on.

Installation:
Read more about this resource...
 

time

Active member
#4
I want to create 1 field to enter the start time and end time, the time between start and finish, will display the message contents are operating in forum_view.

Can you guide me?
 

Mike Edge

Well-known member
#5
We release all of our add-ons for free to non-commercial sites because we want to support the XenForo Community. If you appreciate this and want to help us with some other causes we are championing, please consider donating to the Waindigo Foundation (registered charity number: 1150526).
I was looking to read more information on your Waindigo Foundation that you posted, but the link gives a page not found error when clicking it. It links to http://www.charitycommission.gov.uk...ramework.aspx?RegisteredCharityNumber=1150526 Figured you'd like to know so you can correct whatever is causing the error.

Am considering donating, can you give more info on what your Foundation does.
 

arms

Active member
#6
As per other thread!
My only suggestion would be to not autopopulate the date fields as if field isn't mandatory, you can't click on date highlight and then delete. You have to put cursor to right and then backspace, which could be confusing to users. Not a big deal though.
 

Jon W

Well-known member
#7
I was looking to read more information on your Waindigo Foundation that you posted, but the link gives a page not found error when clicking it. It links to http://www.charitycommission.gov.uk...ramework.aspx?RegisteredCharityNumber=1150526 Figured you'd like to know so you can correct whatever is causing the error.

Am considering donating, can you give more info on what your Foundation does.
Thanks for letting me know. I will fix the link. The charity is set up to provide support with web services to other charities. We are currently training volunteers through the charity to do this. We will be setting up a website shortly explaining everything. Obviously we could do all of this without setting up a charity, but I feel that this provides a guarantee that donations will be put towards good use (charities are very heavily regulated in the UK), as well as the other benefits that being a charity provides (such as lower PayPal fees).

Rather than a cash donation (or as well as, if you're feeling generous), I would be very interested to chat to you about donating hosting services to charities. Please let me know if you are interested.

Edit: the link in my signature is the correct one:
http://www.charitycommission.gov.uk/search-for-a-charity/?txt=1150526
 
Last edited:

Jon W

Well-known member
#8
As per other thread!
My only suggestion would be to not autopopulate the date fields as if field isn't mandatory, you can't click on date highlight and then delete. You have to put cursor to right and then backspace, which could be confusing to users. Not a big deal though.
Create a new file in library/Arms/ called CustomDate.php with the following contents:
PHP:
<?php

class Arms_CustomDate
{

    public static function render(XenForo_Template_Abstract $template, array $field)
    {
        if (!$field['field_value']) {
            $field['field_value'] = "";
            $field['field_value_choice'] = 'today';
        } else {
            $field['field_value'] = date("Y-m-d", intval($field['field_value']));
            $field['field_value_choice'] = 'other';
        }
        return $template->create('waindigo_date_input_customfields', array(
            'field' => $field
        ));
    }
}
then replace the PHP callback class for rendering the custom field to Arms_CustomDate.
 
#14
Quite possibly missed something key here.

Wish to add the custom date to the header template html. Using
Code:
{$customFields.waindigo_custom_date}
to insert into the header works ok BUT the date is outputted in unix format. Is it possible to output to the header in regular date format?

When "Viewable on Thread View" is selected in the custom thread field setting the date is then shown above message nicely formatted...
 

Jon W

Well-known member
#15
You can use any of the standard XenForo template helper functions.

For example:
Code:
{xen:datetime $customFields.waindigo_custom_date}
Code:
{xen:time $customFields.waindigo_custom_date}
 
#19
Changing the years on these date fields are really hard. I think the browser developers should make it a priority to change years. Suppose I need to set the date as 1-2-1975 I need to click a lot