1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Add date fields to your threads, posts, resources or user profile.

  1. Jon W

    Jon W Well-Known Member

    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.

    Read more about this resource...
    erich37 and Mrallananas like this.
  2. arms

    arms Active Member

    The custom rating field has been uploaded instead of the date
  3. Jon W

    Jon W Well-Known Member

    Oops. Thanks. Uploaded the correct file now.
    time and intradox like this.
  4. time

    time Active Member

    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?
  5. Da Bookie Mon

    Da Bookie Mon Well-Known Member

    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.
  6. arms

    arms Active Member

    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 likes this.
  7. Jon W

    Jon W Well-Known Member

    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:
    Last edited: Jul 12, 2013
  8. Jon W

    Jon W Well-Known Member

    Create a new file in library/Arms/ called CustomDate.php with the following contents:

    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';
    $template->create('waindigo_date_input_customfields', array(
    'field' => $field
    then replace the PHP callback class for rendering the custom field to Arms_CustomDate.
  9. arms

    arms Active Member

    Thanks @Waindigo . That's sorted it.
    Jon W likes this.
  10. Jon W

    Jon W Well-Known Member

    Any reason this can't be done as two fields?
  11. arms

    arms Active Member


    When you add a date it takes servertime as the time. Therefore adding confusion as states a time. And why store 2 fields when stored as Unix timestamps (1373587200).
  12. Jon W

    Jon W Well-Known Member

    Oops. I'll post an update for this.

    They are too distinct pieces of information so it would make sense to store them as separate fields.
  13. Jon W

    Jon W Well-Known Member

  14. johnbd

    johnbd New Member

    Quite possibly missed something key here.

    Wish to add the custom date to the header template html. Using
    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...
  15. Jon W

    Jon W Well-Known Member

    You can use any of the standard XenForo template helper functions.

    For example:
    {xen:datetime $customFields.waindigo_custom_date}
    {xen:time $customFields.waindigo_custom_date}
  16. Code Monkey

    Code Monkey Well-Known Member

    So this just adds a date field?
  17. Code Monkey

    Code Monkey Well-Known Member

    Any examples of what this can be used for? I need pictures. :D
  18. Jon W

    Jon W Well-Known Member

    I've added a screenshot. It is just another custom field type, so it can do anything that custom fields can do.
  19. smartpixels

    smartpixels Active Member

    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
  20. KiF

    KiF Member

    It seems that it doesn't work with XF 1.2.1. @Waindigo , can you look at this, please?

Share This Page