Jeremy, thanks.
It worked. I cut and pasted this into a file, imported into TW5, and
that's it. I created a tiddler with a start field "20120101", and another
tiddler with the following list:
<$list filter="[has[start]]">
<$view field="start" format="date"/>
</$list>
I have noticed, the date field is set to time in UTC. When the field is
set to "20120101", then <$view field="start" format="date"/> renders it as
December 31, 2011. Is there a way to interpret dates in local time?
Thanks.
--
Arkady
On Tuesday, October 29, 2013 1:57:05 AM UTC-7, Jeremy Ruston wrote:
>
> The tiddlerfields that are defined in the core are not full modules
> because they are needed before the tiddler loading mechanism is fully
> installed. That call to $tw.modules.define() directly defines the module
> exports.
>
> For a normal module, you should use something like this:
>
> /*\
> title: $:/plugins/arkadygrudzinsky/startfield.js
> type: application/javascript
> module-type: tiddlerfield
>
> Implements the start field as a date
>
> \*/
> (function(){
>
> /*jslint node: true, browser: true */
> /*global $tw: false */
> "use strict";
>
> exports.name = "start";
> exports.parse = $tw.utils.parseDate;
> exports.stringify = $tw.utils.stringifyDate;
>
> })();
>
> Let me know how you get on,
>
> Best wishes
>
> Jeremy
>
>
>
> On Tue, Oct 29, 2013 at 1:19 AM, Arkady Grudzinsky
> <[email protected]<javascript:>
> > wrote:
>
>> Jeremy,
>>
>>
>>
>>>> - Are tiddler fields always treated as text or is it possible to
>>>> set a field type (e.g. date, integer, etc.).
>>>>
>>>> Tiddler fields are strings by default, but can be typed through the use
>>> of "tiddlerfield" modules. The core tiddlerfields are in boot.js:
>>>
>>> https://github.com/Jermolene/**TiddlyWiki5/blob/master/boot/**
>>> boot.js#L713<https://github.com/Jermolene/TiddlyWiki5/blob/master/boot/boot.js#L713>
>>>
>>>
>> A newbie question.
>>
>> I was able to chage my custom "start" field type to "date" by adding this
>> to boot.js:
>>
>> $tw.modules.define("$:/boot/modules/tiddlerfields/start","tiddlerfield",{
>>
>> name: "start",
>> parse: $tw.utils.parseDate,
>> stringify: $tw.utils.stringifyDate
>> });
>>
>>
>>
>> After that I was able to use
>>
>>
>> I guess, it's not a good idea to mess with boot.js. So, I tried to
>> create a tiddler called "$:/boot/modules/tiddlerfields/start" and set its
>> type to "application/javascript", "module-type: tiddlerfield". But I could
>> not get it to register. It seems, I'm missing how to get the .js tiddler
>> code registered as a module.
>>
>> I also tried naming the tiddler "$:/core/modules/tiddlerfields/start"
>> thinking that boot somehow loads all "$:/core/modules" tiddlers, but it did
>> not work. What am I missing?
>>
>> Thanks.
>>
>> --
>> Arkady
>>
>>
>> On Saturday, October 26, 2013 7:12:39 AM UTC-7, Jeremy Ruston wrote:
>>
>>> Hi Arkady
>>>
>>> Thanks for the encouragement, and the detailed feedback, much
>>> appreciated.
>>>
>>>
>>>> I'm currently using mGSD to manage my tasks. Recently tried TW5. I
>>>> think, it's awesome. Wanted to thank Jeremy for Tiddlywiki. <$list> and
>>>> <$checkbox> widgets available at TW5 are very handy to create task lists
>>>> by
>>>> project/context/contact. The TW5 ability to manipulate and customize
>>>> tiddler fields is a great addition. I was able to create <$list> of tasks
>>>> sorted by custom fields such as "start", "due", or "priority". I also
>>>> love
>>>> the minimalism of the interface.
>>>>
>>>
>>> Great, I'm glad that the checkbox and list widgets are understandable.
>>>
>>>
>>>> Couple of questions about TW5 features for which I could not find
>>>> documentation. I'm thinking of implementing recurring tasks in TW5. I
>>>> envision using tags "recurring" and "weekly"/"daily"/"monthly", etc. and
>>>> use fields such as "start", "modified", etc. So, my questions are:
>>>>
>>>> - Is it possible to set <$list> filter to select tiddlers using
>>>> comparisons? E.g. select tiddlers with "start" date before "now" to
>>>> make
>>>> tasks appear on the list at certain date/time? Perhaps, it's possible
>>>> to
>>>> do it in a similar fashion as mGSD handles ticklers, but I thought,
>>>> <$list>
>>>> widget might offer a much simpler way.
>>>>
>>>> There's no comparison operators yet, but the plan is to have them as
>>> filter operator modules. See the "has" operator as an example:
>>>
>>> https://github.com/Jermolene/**TiddlyWiki5/blob/master/core/**
>>> modules/filters/has.js<https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/filters/has.js>
>>>
>>>>
>>>> - Is it possible to set <$list> filter to select tiddlers with
>>>> tags/titles matching a regular expression?
>>>>
>>>> Not at the moment, but it's a good idea.
>>>
>>>>
>>>> - Is it possible to have <$checkbox> widget do more than assign a
>>>> tag to a tiddler? E.g. Can it increment the "start" date field by 7
>>>> days?
>>>>
>>>>
>>> Not yet. TW5 doesn't yet really have the general concept of programmable
>>> actions, but something along those lines is going to be useful. For the
>>> moment, I'd expect a GxD implementation to have it's own extended checkbox
>>> widget.
>>>
>>>>
>>>> - Are tiddler fields always treated as text or is it possible to
>>>> set a field type (e.g. date, integer, etc.).
>>>>
>>>> Tiddler fields are strings by default, but can be typed through the use
>>> of "tiddlerfield" modules. The core tiddlerfields are in boot.js:
>>>
>>> https://github.com/Jermolene/**TiddlyWiki5/blob/master/boot/**
>>> boot.js#L713<https://github.com/Jermolene/TiddlyWiki5/blob/master/boot/boot.js#L713>
>>>
>>>
>>>>
>>>> - Is it possible to create contextual tiddler templates? E.g.
>>>> - when a tiddler is tagged as "project", the tiddler view would
>>>> automatically show lists of tasks or
>>>> - when a tiddler is tagged as "context", the tiddler view would
>>>> automatically show a list of tasks orgainzed differently, etc.
>>>> (similar behavior as in mGSD, only I would expect a more
>>>> transparent and customizeable syntax with <$list> and <$view>. In
>>>> mGSD,
>>>> it's done through macros which are hard to find and difficult to
>>>> customize.)
>>>>
>>>> You can almost do that in a basic form with the reveal widget.
>>> Basically each type of view that you need would be a separate ViewTemplate
>>> segment (i.e. a tiddler tagged $:/tags/ViewTemplate). You'd wrap it in a
>>> reveal widget that would selectively display the template depending on the
>>> tags on the current tiddler. The reveal widget doesn't yet allow for
>>> testing tags, though.
>>>
>>>
>>>>
>>>> - Would be nice to have an easy way to create a tiddler with a
>>>> certain template (e.g. create buttons with custom functionality). I
>>>> have a
>>>> feeling that buttons are already implemented, but not documented. Is
>>>> it
>>>> true?
>>>>
>>>> There is a button widget that's used for the new tiddler button:
>>>
>>> <$button message="tw-new-tiddler" class="btn-invisible">{{$:/**
>>> core/images/new-button}}</$**button>
>>>
>>> The plan is to extend the tw-new-tiddler message so that the title of a
>>> template tiddler can be provided.
>>>
>>>> Finally, I may be reinventing the wheel. Is there a GTD implementation
>>>> based on TW5? Even if there is, I, probably, would want to customize a
>>>> few
>>>> things. So, I still would like to know the answers.
>>>>
>>> No, there's no GTD implementations that I'm aware of.
>>>
>>> Do be aware that TW5 will undergo quite significant changes in the next
>>> couple of days as I complete a round of refactoring that I've been doing.
>>> With the new changes the generated HTML is much cleaner, and the individual
>>> widgets have been rationalised and simplified:
>>>
>>> https://github.com/Jermolene/**TiddlyWiki5/pull/178<https://github.com/Jermolene/TiddlyWiki5/pull/178>
>>>
>>>
>>>> Thanks again to all Tidlywiki developers. It's an awesome tool for
>>>> many things. I have not seen so much functionality packed in ~600K of
>>>> code.
>>>>
>>> Thank you, much appreciated. Eventually we'll minify the TW5 core by
>>> default, which should reduce the footprint somewhat!
>>>
>>> Best wishes
>>>
>>> Jeremy
>>>
>>>
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "TiddlyWiki" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to tiddlywiki+...@**googlegroups.com.
>>>> To post to this group, send email to [email protected].
>>>>
>>>> Visit this group at
>>>> http://groups.google.com/**group/tiddlywiki<http://groups.google.com/group/tiddlywiki>
>>>> .
>>>> For more options, visit
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>
>>>
>>>
>>> --
>>> Jeremy Ruston
>>> mailto:[email protected]
>>>
>>
>
>
> --
> Jeremy Ruston
> mailto:[email protected] <javascript:>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.