Dataforms do not currently have a way to handle dates so we have to put the dates into text fields. As dataforms get used more and more for databases this is not a good solution. So I would like to see a date field type added. I do not know how the dd/mm/yy | mm/dd/yy difference might be dealt with, but a date field type of some sort is needed and will be very useful, particularly when we get ordering by dataform values (accepted wish http://feedback.wikidot.com/wish:205).
DESIGN:
(suggested by James Kanjo)
I would suggest using the current Wikidot format of storing dates also be used to store DataForm Date fields.
More explained, dates should be stored as the number of seconds following the 1st of January 1970 UTC.
In this way, it maintains compatibility with the [[date …]] syntax.
It may have to include leading zeros so that the ListPages module can sort the Date field numerically.
There's a standard format which can be used to store dates, so the only thing regarding different date formats is the actual display/presentation of it. The current way of formatting dates is very powerful, so I'm sure if Wikidot can work that into the form_data variable somehow we'll have everything we need there…
Voted up :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Bump!
There are so many things that could make Wikidot better, things like Download count, this, file count, and the openid for user authentication, and many many more. I really hope the wikidot team doesn't ignore these :(
Is there any progress on this being accepted and developed?
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
I would really like to see this implemented, and be able to order by date using ListPages.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I bumped it again because almost every site I develop needs an events section with dates. Data forms are an obvious way to manage entry of event information. But the problem comes when trying to order the events with the ListPages module because we have no date field. It is therefore impossible to handle event dates unless the events are entered in order which is not a realistic solution. Look at the mess you get in the (text) date column here!
So please Wikidot, this would be a huge addition to the dataform functionality.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Even if they do create a date field, it's only practical if they also implement sorting pages by field types at the same time.
This is exactly the same reason I posted another comment. Someone is asking me for an events section on a website - it's the main function/feature they want!
Looked at the link and I see what you're referring to. Not only are dates in different formats, but as a result of that they're also completely out of order.
I might have to resort to creating an application that they can run on their computer instead - offering a proper date-time field and then using the API to create the page in a way that allows me to list it properly.
The problem is that this will take me much longer to do, costing the client more than they should have to pay (I'm the one getting paid, but I'd still prefer to keep their costs down!)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Implementing the date field would solve at least one problem: different formats for the date (see the link in Rob's post). Assumedly, we could control the format for a DataForm date field in the same way we can control the format for variables like %%created_at%%.
But yes, for this to be truly useful, we also need sorting by date fields to be implemented.
Maybe there is a solution for this problem using JavaScript. I think the Calendars app isn't quite good enough because you need to manually edit the page each month to show the latest events, and it a bit too much for what I need (just creating pages in a category, then listing them in order of date).
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Calendars app was created before Data Forms existed too, I think? It truly is a masterpiece for showing off what Wikidot (the software/code) can do when it's prodded in the right direction :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Indeed, the calendars app is due for a refurb. One of my many plans :)
Absolutely, one without the other would make the date field a bit pointless.
For wikidot; the latest site needing both of these is at http://www.strathpeffervillage.org.uk/forevents:here. Until the date field and sorting get implemented I can see with some despair that I will have a huge job to keep events in order and within 2 days will get one of the site editors saying "why is my event out of order?" (Rob groans and goes to open a bottle of wine and watch daytime TV as consolation).
James, many thanks for that regex for the date in a text field, I have implemented it for the events on this site as well.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
…and just when the devs thought it was safe to come out, along comes another site needing a dataform date field (plus sorting) for shows and festivals at http://smpcentre.wikidot.com.
Off-topic slightly but this is another site where the content editors will only ever see dataforms and will not use the normal editor at all. This has proved very popular; most people asking me to do new sites (or update existing ones) want to go down this CMS route.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Whoo hoo, just seen this has been accepted: brilliant.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
The new selecting and sorting by data form fields comes so close to achieving this data form date field wish because it almost means we can have year, month and date fields and sort on them which is the whole purpose of the wish The only thing that is stopping it being completed seems to be that sorting can only be done on a single data form field. Is this correct and that sorting doesn't work across multiple fields? My tests here indicate this is the position and perhaps it is for performance reasons. But it would be great if you could allow sorting across multiple fields to do so which would mean that, as far as I can see, this wish would be have been achieved and no further work would be required on it
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
As a developer, I would be inclined to harness the client's machine to sort multiple fields… i.e. using the server to sort the first field, then the client's JavaScript to sort other fields.
Been about a year since this request, and I just hope it was not forgotten. Unfortunately I need to sort based on an inputted date (dataform). Even using a number like 20120520 won't work because numbers are treated as letters. The only solution I can think of is to assign letters to each set of numbers
for example:
2012-05-20 would be "m-f-u"
based on http://cryptoclub.math.uic.edu/substitutioncipher/ltr_num.htm
unfortunately this approach breaks down after 26, which is fine for days and months, but not years. could probable be improved. this would have to be for a background admin task (not for regular site users)
could someone help me improve upon this?
Well I find it hard te believe that the number solution you mention does not work for ordening puposes.
http://try.wikidot.com/orderbynumber:_root
Works fine
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Yes that does work. Last year I contracted Shane (leiger) to produce a very good api application for me which my users at http://www.strathpeffervillage.org.uk use after entering event details. It takes the date entered into the dataform (23/06/2012) and the event title and changes the pagename from for example event:1 to event:20120628-castle-leo which is very similar to what you have produced there Steven. But entering that "reversed" format manually into the dataform field is not very user-friendly. So I really hope that this wish will be implemented soon - it's been a year since it was accepted!
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Agreed, I'd like to see this wish implemented as well. The application I developed for you was always intended to be a temporary step, with something like this wish eventually replacing it.
By the way, have you had any problems with it? Sounds like it's still working well ;-)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I've never had a single problem with it and neither have my users. It works very well indeed.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
YYYY/YY-MM-DD formats would be sorted correctly, even if ordered by letter. Provided the month and day is written in two digits.
However, the date format requested in this wish is in the number of seconds after 1 January 1970, not the standard YY-MM-DD format.
I must have been doing something wrong, thanks for the help.