Date Words function - plagiarized

Bob Sneidar bobsneidar at iotecdigital.com
Tue Oct 7 11:24:49 EDT 2025


I wrote my own version of dateWords from scratch. If it’s the name that is the trouble I can rename it, or if it really tans your hide I will purchase a copy from you if I know where to find it. 

Here is my version: 

function dateWords pDate
   if word 1 of pDate is not among the items of "last,next,yesterday,today,tomorrow" then \
         return empty
   
   put date() into tCurrentDate
   convert tCurrentDate to dateItems
   
   if the number of words of pDate = 2 then
      put "sunday,monday,tuesday,wednesday,thursday,friday,saturday" into tDaysOfWeek
      put itemOffset(word 2 of pDate, tDaysOfWeek) into tDayNumber
      put item 7 of tCurrentDate into tThisDayNumber
      
      if tDayNumber = 0 then \
            return empty
   end if
   
   switch
      case word 1 of pDate is "last"
         if tDayNumber >= tThisDayNumber then \
               subtract 7 from item 3 of tCurrentDate
         add (tDayNumber - tThisDayNumber) to item 3 of tCurrentDate
         break
      case word 1 of pDate is "next"
         add 7-tDayNumber to item 3 of tCurrentDate
         break
      case pDate is "yesterday"
         subtract 1 from item 3 of tCurrentDate
         break
      case pDate is "today"
         -- don't do anything
         break
      case pDate is "tomorrow"
         add 1 to item 3 of tCurrentDate
         break
   end switch
   
   put formatDate(tCurrentDate, "standard") into pDate
   return pDate
end dateWords

> On Oct 6, 2025, at 10:24 PM, Curry Kenworthy via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 
> Bob Sneidar 'Date Words' looks plagiarized from my original.
> scammers who plagiarize - cease and desist.
> 
> honest folks who attribute - use/mod, enjoy!
> I hope to update more code when health improves...
> 
> Bob Sneidar:
> 
> > Did you ever want to use phrases like yesterday, last tuesday
> > or next friday in a date field?
> 
> > function dateWords ...
> 
> Best wishes,
> 
> Curry Kenworthy
> 
> "Dominate documents with WordLib and LC"
> https://livecodeaddons.com/wordlib.html
> 
> (Still recuperating from illness - comments limited.)
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list