How formatting date fields on attribute table?

已查看 90 次
跳至第一个未读帖子
已由我分配给lorenzo...@geosolutionsgroup.com

Pedro Garcia

未读,
2023年3月13日 09:36:222023/3/13
收件人 mapstore-users
Hi all,
Values displayed for date fields are not displayed in an understandable way for users, as you can see in attached image. Is there any way to format date fields displayed on attribute table as is showed on postgres?
Thanks.

borrar.png

Pedro Garcia

未读,
2023年3月14日 04:30:432023/3/14
收件人 mapstore-users
I have found this solution:
It's neccesary to start Geoserver with this Java option:
-Dorg.geotools.localDateTimeHandling=true

Lorenzo Natali

未读,
2023年3月14日 06:38:552023/3/14
收件人 mapstore-users
Hi,
MapStore shows the date-time data in standard ISO format, that is the one handled by GeoServer. To have a different formatting, you can configure the FeatureEditor plugin to use your local format for date and time.



therefore in "localConfig.json" file, replace plugins --> desktop --> "FeatureEditor" string with an object like this : 
{
 "name": "FeatureEditor",
 "cfg": {
"dateFormats": {
   "date-time": "MM DD YYYY - HH:mm:ss",
   "date": "MM DD YYYY",
   "time": "HH:mm:ss"
}

GB RL

未读,
2023年10月25日 09:24:512023/10/25
收件人 mapstore-users
Hi,
I follow the last comment, but this doesn't works (bad config i guess ?).

Here my (classic) use case 

1. Save data in postgis with 1 DATE field (PG_FIELDS picture)
2. Publish data with GeoServer (see detected fields in GS_FIELDS picture)
3. Create a MapStore2 contexte, and add this FeatureEditor config

    "cfg": {
        "dateFormats": {
            "date-time": "MM DD YYYY - HH:mm:ss",
            "date": "MM DD YYYY",
            "time": "HH:mm:ss"
        }
    },

4. See that fields are not formated (ms_fields picture)

Could you confirm that dateFormats allow to change date display in attribute table ?

Thanks.

GB


ms_fields.JPG
GS_FIELDS.JPG
PG_FIELDS.JPG

GB RL

未读,
2023年11月6日 05:17:342023/11/6
收件人 mapstore-users
Hi,
Does anyone have a working example of this ?

gaetan....@gmail.com

未读,
2024年1月10日 04:47:151月10日
收件人 mapstore-users
Hi,
Datetime format config works fine with MapStore2 2023.02.xx .

Here, configs, data and definitions used :
  • PostgreSql fields definitions 
temp_date3.JPG

  • Datetime format render without FeatureEditor dateFormats config
temp_date0.JPG
  • Datetime format render with  FeatureEditor dateFormats config
temp_date1.JPG
  • GeoServer columns
temp_date2.JPG
  • localConfig.json use
              "cfg": {
                "dateFormats": {
                  "date-time": "MM DD YYYY - HH:mm:ss",
                  "date": "MM DD YYYY",
                  "time": "HH:mm:ss"
              },


I hope this message will be useful to others.

Gaëtan B
Jdev
======

Simone Giannecchini

未读,
2024年1月10日 08:40:181月10日
收件人 mapstor...@googlegroups.com
Hi Gaetan,
thanks for taking the time to provide this information.

Regards,
Simone Giannecchini
==
Online training classes for GeoNode, GeoServer and MapStore from the experts!
Visit https://www.geosolutionsgroup.com/professional-training/ for more information.
==
Ing. Simone Giannecchini
@simogeo
Founder/Director GeoSolutions Italy
President GeoSolutions USA


http://www.geosolutionsgroup.com
http://twitter.com/geosolutions_it

-------------------------------------------------------
This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.


--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/fe7233e0-7e96-462e-bacd-fbc6c873ead8n%40googlegroups.com.
回复全部
回复作者
转发
0 个新帖子