From chughes at co.lincoln.or.us Wed Oct 7 10:56:07 2026 From: chughes at co.lincoln.or.us (Christopher Hughes) Date: Wed, 7 Oct 2026 17:56:07 +0000 Subject: [GeoMoose-users] Results Templates - Format Dates Message-ID: Hello everyone, I was curious if anyone has had success altering date formats specifically in GeoMoose's template results. I've had some success adjusting the results using the pipes found at adammark/Markup.js: Powerful JavaScript templates (i.e. converting results to uppercase/lowercase, adjusting the default null value, replacing one string with another). It does give some examples of how to format dates, but I wasn't sure how to implement that in GeoMoose's deployment of MarkUp. The issue is I'm trying to connect to a rest service (so I don't have control of the data at the source). It has a few fields that come through as YYYY-MM-DDTHH:MM:SS-[whatever the UTC modifier is] (which works but is a bit ugly), and a couple that come through as the number of seconds since 1970 (which is less useful for the average person). Chris -- Chris Hughes GIS Analyst Lincoln County GIS Department 880 NE 7th St. l Newport, OR 97365 Tel: (541) 574 1283 -------------- next part -------------- An HTML attachment was scrubbed... URL: From theduckylittle at gmail.com Wed Oct 7 13:53:41 2026 From: theduckylittle at gmail.com (Dan Little) Date: Wed, 7 Oct 2026 15:53:41 -0500 Subject: [GeoMoose-users] Results Templates - Format Dates In-Reply-To: References: Message-ID: While not a totally perfect solution, Javascript's lack of types can be kinda valuable here: function normalizeDate(value) { const d = new Date(value); // this will do a best guess return (new Intl.DateTimeFormat().format(d)); // this will use the user's locale to format the date } That could be used in a pipe to format arbitrary date values. A little duck-typing/data checking could make it a lot safer. On Wed, Oct 7, 2026 at 12:56?PM Christopher Hughes via GeoMoose-users < geomoose-users at lists.osgeo.org> wrote: > Hello everyone, > > I was curious if anyone has had success altering date formats specifically > in GeoMoose's template results. I've had some success adjusting the results > using the pipes found at adammark/Markup.js: Powerful JavaScript templates > (i.e. converting results to > uppercase/lowercase, adjusting the default null value, replacing one string > with another). It does give some examples of how to format dates, but I > wasn't sure how to implement that in GeoMoose's deployment of MarkUp. > The issue is I'm trying to connect to a rest service (so I don't have > control of the data at the source). It has a few fields that come through > as YYYY-MM-DDTHH:MM:SS-[whatever the UTC modifier is] (which works but is a > bit ugly), and a couple that come through as the number of seconds since > 1970 (which is less useful for the average person). > Chris > -- > Chris Hughes > > GIS Analyst > Lincoln County GIS Department > 880 NE 7th St > . > l Newport, OR 97365 > Tel: (541) 574 1283 <(541)%20574-1283> > > _______________________________________________ > GeoMoose-users mailing list > GeoMoose-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/geomoose-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chughes at co.lincoln.or.us Wed Oct 7 16:09:31 2026 From: chughes at co.lincoln.or.us (Christopher Hughes) Date: Wed, 7 Oct 2026 23:09:31 +0000 Subject: [GeoMoose-users] Results Templates - Format Dates In-Reply-To: References: Message-ID: Thanks I'll do some testing -- Chris Hughes GIS Analyst Lincoln County GIS Department 880 NE 7th St. l Newport, OR 97365 Tel: (541) 574 1283 ________________________________ From: Dan Little Sent: Wednesday, October 7, 2026 1:53 PM To: Christopher Hughes Cc: Espoir SINS via GeoMoose-users Subject: Re: [GeoMoose-users] Results Templates - Format Dates While not a totally perfect solution, Javascript's lack of types can be kinda valuable here: function normalizeDate(value) { const d = new Date(value); // this will do a best guess return (new Intl.DateTimeFormat().format(d)); // this will use the user's locale to format the date } That could be used in a pipe to format arbitrary date values. A little duck-typing/data checking could make it a lot safer. On Wed, Oct 7, 2026 at 12:56?PM Christopher Hughes via GeoMoose-users > wrote: Hello everyone, I was curious if anyone has had success altering date formats specifically in GeoMoose's template results. I've had some success adjusting the results using the pipes found at adammark/Markup.js: Powerful JavaScript templates (i.e. converting results to uppercase/lowercase, adjusting the default null value, replacing one string with another). It does give some examples of how to format dates, but I wasn't sure how to implement that in GeoMoose's deployment of MarkUp. The issue is I'm trying to connect to a rest service (so I don't have control of the data at the source). It has a few fields that come through as YYYY-MM-DDTHH:MM:SS-[whatever the UTC modifier is] (which works but is a bit ugly), and a couple that come through as the number of seconds since 1970 (which is less useful for the average person). Chris -- Chris Hughes GIS Analyst Lincoln County GIS Department 880 NE 7th St. l Newport, OR 97365 Tel: (541) 574 1283 _______________________________________________ GeoMoose-users mailing list GeoMoose-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/geomoose-users -------------- next part -------------- An HTML attachment was scrubbed... URL: