Modifying created and modified parsing for tiddlers.

This commit is contained in:
ruidajo 2022-03-08 17:32:41 -05:00
parent e4e9323356
commit c1568365f3
2 changed files with 8 additions and 9 deletions

View File

@ -28,8 +28,8 @@ Class {
{ #category : #'instance creation' } { #category : #'instance creation' }
Tiddler class >> nowLocal [ Tiddler class >> nowLocal [
^ (ZTimestampFormat fromString: '20010203160506700') ^ ((ZTimestampFormat fromString: '20010203160506700')
format: (ZTimestamp fromString: Time nowLocal asDateAndTime asString) format: (ZTimestamp fromString: Time nowLocal asDateAndTime asString)) copyFrom: 1 to: 17
] ]
{ #category : #accessing } { #category : #accessing }
@ -38,12 +38,12 @@ Tiddler >> asDictionary [
response := Dictionary new response := Dictionary new
at: 'title' put: self title; at: 'title' put: self title;
at: 'text' put: self text; at: 'text' put: self text;
at: 'created' put: self created asString; at: 'created' put: self created;
at: 'tags' put: self tags; at: 'tags' put: self tags;
at: 'type' put: self type; at: 'type' put: self type;
at: 'creator' put: self creator; at: 'creator' put: self creator;
at: 'modifier' put: self modifier; at: 'modifier' put: self modifier;
at: 'modified' put: self modified asString; at: 'modified' put: self modified;
at: 'bag' put: self bag; at: 'bag' put: self bag;
at: 'revision' put: self revision; at: 'revision' put: self revision;
yourself. yourself.
@ -110,7 +110,7 @@ Tiddler >> caption: anObject [
{ #category : #accessing } { #category : #accessing }
Tiddler >> created [ Tiddler >> created [
^ created asZTimestamp ifNil: [ created := self class nowLocal ] ^ created ifNil: [ created := self class nowLocal ]
] ]
{ #category : #accessing } { #category : #accessing }
@ -348,8 +348,7 @@ Tiddler >> markdownLinksAsWikiText [
{ #category : #accessing } { #category : #accessing }
Tiddler >> modified [ Tiddler >> modified [
modified ifNil: [ ^ modified ]. ^ modified
^ modified asZTimestamp
] ]
{ #category : #accessing } { #category : #accessing }

View File

@ -58,9 +58,9 @@ TiddlyWiki >> changesAfter: aDateString [
| recent created modified wiki aDate | | recent created modified wiki aDate |
aDate := aDateString asZTimestamp. aDate := aDateString asZTimestamp.
wiki := self contentTiddlersWithoutLargeTiddlers. wiki := self contentTiddlersWithoutLargeTiddlers.
created := wiki select: [ :tiddler | tiddler created > aDate ]. created := wiki select: [ :tiddler | tiddler created asZTimestamp > aDate ].
modified := wiki select: [ :tiddler | tiddler modified isNotNil modified := wiki select: [ :tiddler | tiddler modified isNotNil
and: [ tiddler modified > aDate ] ]. and: [ tiddler modified asZTimestamp > aDate ] ].
recent := OrderedCollection new. recent := OrderedCollection new.
recent recent