Nutt, I use date stamps a lot, especially to drive periodical items, for example a weekly-review field with a date stamp becomes due again once the date stamp is older than 7 days. I do not touch javascript.
Here are some quick leads. - Set a field to the result of <<now "[UTC]YYYY0MM0DD0hh0mm0ssXXX">> see <https://tiddlywiki.com/#Date%20Fields> and this <https://tiddlywiki.com/#now%20Macro> - Use a button to setfield - Use the Date Picker Plugin http://kixam.github.io/TW5-datePicker/ Try this trick if you want to accept simple formatted dates <$edit-text field="date-field" field="myconfig" type="date"/> But then you would be wise to convert these to tiddlywiki date/time serial number to make full use of the days operator and more such as comparing with a system date or today. *Just ask if you come across some gaps!* It is my considered view if you are using javascript functions in tiddlywiki rather than its existing methods - You are doing it the wrong way - You have discovered a gap that should be considered as a new feature or a plugin to be developed for the community. Regards Tony On Friday, April 17, 2020 at 12:01:35 PM UTC+10, grundyunderhill wrote: > > Hi all, > Is there any way to make TW treat a user-defined field as a timestamp, > like it does for the built-in "created" and "modified" fields? > > My use case is that I want to capture timestamps of other events (besides > creation and modification), and be able to perform Date-related > calculations against them. Closest I've come so far is saving a string in > same format as it uses for "modified", and writing a custom filter operator > which calls $tw.Tiddler.fieldModules.modified.parse() to convert string to > Date object. It works, but I feel like it would be cleaner if I could just > check whether it's a Date already, and ignore everything else... > > Thanks, > Nutt > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/10442777-5c2a-48da-b622-731901351256%40googlegroups.com.

