This is right! As both assumed the same. So, you need one field not two!
If you have many tiddlers with two fields or you want to change due-date
to due
simply use Commander, it can remove one, or rename or merge,…
This is not an issue with previous tiddlers…i don’t have huge amount of todo tiddlers for removing fields. The problem is I have to always keep on doing this correction if I plan to use Pikaday. One way is to not use pikaday. But obviously pikaday has certain advantages like date picker availability in subtitle which I like to make use of.
My workflow is to use Pikaday in view mode. It can be added using a viewtemplate. You can have also on subtitle. In edit mode of table, I do not touch due field. This is correct when you edit a todo on its own tiddler.
By the way, if you are insisted to use pickaday on edit mode, then your due column template should just transclude the pikday button, no difference between view/edit.
The extra works is to use css to have it nicely positioned inside a table cell.
This is the code for due-date coulmn template
\define showCell()
<$set tiddler=<<currentRecord>> field=<<currentColumn>> name=due-date>
<$text text={{{[<due-date>split[-]split[.]join[]format:date[YYYY.0MM.0DD]]}}} />
</$set>
\end
\define showCell_Locked() <span style="font-style:oblique;"><<showCell>></span>
\define edit_date() <$edit-text tag=input type=date tiddler=<<currentRecord>> field=<<currentColumn>>/>
<$reveal type="nomatch" stateTitle=<<tempTableEdit>> stateIndex="mode" text="edit" tag="td" class="shiraz-dtable-date">
<<showCell>>
</$reveal>
<$reveal type="match" stateTitle=<<tempTableEdit>> stateIndex="mode" text="edit" tag="td">
<!--check if the current column is not selected for sorting-->
<$list filter="[<tempTableSort>getindex[sortIndex]match<currentColumn>]" variable=ignore
emptyMessage=<<edit_date>> >
<<showCell_Locked>>
</$list>
</$reveal>
<!-- Part of Task Manager
this template ALWAYS works on fields -->
How and where to transclude the pikaday button here. When I tried, selecting date for due
field for one todo changes the date for all todos to the same date.
Please try this
<$tiddler tiddler=<<currentRecord>> >
{{||$:/plugins/kookma/pikaday/ui/buttons/TodoDueDate}}
</$tiddler>
This one is working…but I will have do some css tweaking to adjust the position of date-picker…date picker is appearing well above the tiddler with dynamic table.
Does this code need some modification (other than changing due-date to due) …the todos are not getting collected in the corresponding journal tiddler…
I think you are on the right track.
Yes, the CSS part needs more work. That is why I stick with pikaday in view mode!
Umm… I wonder if would be possible to have something that adds hour information to the pick a day widget. So if it is clicked would allow to be more specific and if not, it just add info about the date.
I have no idea! as it needs JS.
Mohammad and all,
Tagging on with interest for adding hours, simply because – at present – this is the only way for people west of GMT0 to get dates to work properly.
The pikaday and related tools fail “out of the box” for those of us in “negative” time zones: In a dynamic table date picker, I pick Sept 1 in edit mode, and when I return to view mode the display shows Aug 31.
I can make the offset manually when I type into a regular date field (by adding a time suffix like 12 [or even 9!] after the date, as in 2022090112).
I do wish we we could all, as a community, find a way to have a timezone setting somewhere that just works for things like a date picker. If we could do that, maybe Pikaday could check that time-zone offset and automatically adjust to consider midnight “my time” in getting the date string (even if time-specification isn’t added to the picker).
-Springer
I believe pikaday does this automatically!
I just tested and it creates a date like below
20220915120000000
Would you please test this using the online demo!
Mohammad,
My mistake. It was in Shiraz that the in-column date picker (in the task-manager’s due date column for example) was yielding the wrong date as soon as I would switch from edit (which would show the date I intended) to display mode (which would show the date before). This is as true on your demo site (as it loads for me in my backwards time zone) as in my own installations of Shiraz:
https://kookma.github.io/TW-Shiraz/#demo%2Fdynamic-table%2Ftask-manager
-Springer
I am not sure whether this is related to your issues with timezone.
Just take a look at this discussion where Eric talks about similar timezone issues - How to filter by due date of today in shiraz dynamic table - #25 by EricShulman
It may be of help for you.
Hi @arunnbabu81, The advice from @EricShulman was " try using an explicit UTC format (i.e., [UTC]YYYY-0MM-0DD
) as the operand for the format:date[]
filter."
But this is not a filter issue, at least not in any straightforward way; the problem is the date is displaying incorrectly – on the very same tiddler – as soon as I choose it (and move from edit to view mode).
This seems like something that ought to be fixable by something other than a personal workaround, since presumably somewhere near half of the people who use any given date-picker solution will be behind UTC.
In $:/plugins/kookma/shiraz/templates/body/due-date
, there is the following macro definition:
\define showCell()
<$set tiddler=<<currentRecord>> field=<<currentColumn>> name=due-date>
<$text text={{{[<due-date>split[-]split[.]join[]format:date[YYYY.0MM.0DD]]}}} />
</$set>
\end
As per my previous guidance referenced by @arunnbabu81, adding [UTC]
to the format:date
filter operand will correct the problem. Thus:
\define showCell()
<$let fmt="[UTC]YYYY.0MM.0DD">
<$set tiddler=<<currentRecord>> field=<<currentColumn>> name=due-date>
<$text text={{{[<due-date>split[-]split[.]join[]format:date<fmt>]}}} />
</$set>
</$let>
\end
-e
Thank you Eric. I patched the template and soon push a new release to include this.
@Springer
I was talking about Pikaday, as the thread is about Pikaday plugin. It seems you have the issue in Shiraz. By the way, if you install Pikaday into your wiki, then Shiraz will use it instead of browser date widget.
Heh, heh. It also happens to me as I have manage to learn as little JS as possble ;-P. I wonder how we could extend TW with non-JS languages. We have done a little bit of it in the back-end with TiddlyWikiPharo, but at some point we would need to explore having a language that transpiles to JS and hooks to TW to change/define UI and behavior. Umm… such exploration deserves its own thread in itself. Thanks for helping finding this “minimal starting experiment”.
I have come late to this thread but I would like to find or build a date picker that appears as only an icon, I can choose the date field, set up for any fieldname, and can save as tiddlywiki date serial numbers, optionally including time.
Further to my last reply/request, I am keen to use other date fields can I make a number of pickers for different date fields?
- To do this I would also need to replace the current button label “schedule” with something else, this would also enable my prior request for “build a date picker that appears as only an icon”.
- Supplying a different icon as well would be nice.
I will try an hack my way to these possibilities but if @Mohammad or others are more familiar with hacking this you may be able to give quicker answers.
Bump, I am looking again at this now
- It seems it may be too hard to reengineer projectify’s date picker for other dates