Bill,
Given that we now have a viable option for storing date/time values in a
single field (eg: string(date;ISO date;time)) why not just modify your
structure, create a new field and write both values to it. Even if you
decide to retain the discrete date & time fields this is not much overhead
and makes implementing anything with JSON a lot easier. Over time you may
eliminate the need for the old fields or not.

Personally I never used date/time fields for scheduling preferring a DTS
(date time string) field instead. This is essentially the ISO string
without the markup. I find the searching and sorting on a single field much
easier and it made transitions like this very east too.

As cool as a lot of the new 4D features are, and I do think they are both
cool and tremendously useful, a lot of those advantages can be lost
attempting to hammer old structures into a shape that allows you to use
them. A little judicious refactoring and structure changes can yield a lot
of benefit.

On Thu, Mar 8, 2018 at 8:09 AM, Bill Hutten via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Thu, Mar 8, 2018, at 11:17 AM, Keisuke Miyako via 4D_Tech wrote:
>
> > OB Copy with pointers is effectively the "record to object" feature.
>
> Ahh - that's useful. Now if only 4D supported pointers to methods. :)
>
> Here's the specific issue: I have a record (many, actually heh) that has
> this sort of structure:
>   [Appts]Title
>   [Appts]Start_Date
>   [Appts]Start_Time
>
> I want to produce this sort of object:
>   { title: "foo", start: '2018-02-12T08:30:00Z' }
>
> Using "OB Copy"I can create a "template" object that will convert the
> pointer->[Appts]Title into the "title" attribute in the copied object. So
> far so good. But what's a clean method to convert the date & time fields in
> the record into a single field in the object?
>
> What I'm doing right now is manually processing the generated object via
> code that does OB SET and OB REMOVE. Not ideal, but it works. Obviously
> method pointers would be a perfect solution, but in the unfortunate absence
> of perfection is there another solution that I'm missing?
>
>
>
> Thanks for your help.
>
> - bill
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************
>



-- 
Kirk Brooks
San Francisco, CA
=======================

*We go vote - they go home*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to