Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date format when using CWP

Featured Replies

  • Newbies

Help! this is driving me nuts...

I wish to display dates in dd/mm/yyyy format using custom web publishing.

At present it refuses to do anything other than mm/dd/yyyy.

(It displays correctly when viewing the database in Instant Web Publishing, and also when exporting the xml directly from FileMaker)

I can see that the xml that is being sent to the cwp engine has "date-format="MM/dd/yyyy" " in the 'datasource' tag (see below), but no idea how to change it. Does anybody know???

-----------------------------

http://intraweb-dev/fmi/xml/fmresultset.xml?-db=Goods_In&-lay=Plain&-findall

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE fmresultset PUBLIC "-//FMI//DTD fmresultset//EN" "/fmi/xml/fmresultset.dtd">

<fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0">

<error code="0"></error>

<product build="08/12/2004" name="FileMaker Web Publishing Engine" version="7.0v3"/>

<datasource database="Goods_In" date-format="MM/dd/yyyy" layout="Plain" table="Goods_In" time-format="HH:mm:ss" timestamp-format="MM/dd/yyyy HH:mm:ss" total-count="1261"/>

<metadata>

<field-definition auto-enter="yes" global="no" max-repeat="1" name="DateEntered" not-empty="no" result="date" type="normal"/>

...

------------------------

You may have to change it when you "process" it. Be it with XSLT or PHP, etc :-(

All the best.

Garry

Caveat: I'm happily using Pro 5.0x

You may find it useful to use unstored calcs as text (not date). One can arrange date functions to the desired order, etc. thru calcs. Enter the data into the field that works with the transmission. Convert thru a calc and display thru a calc on the results page.

You can use the fmxslt:convert_datetime(String oldFormat, String newFormat, String date) extension function (FMS7A Custom Web Publishing Guide, p. 68).

E.g.

xsl:value-of select="fmxslt:convert_datetime('MM/dd/yyyy','yyyy-MM-dd',XPath_to_your_date_field)"/>

I had to remove the < before xsl, otherwise the code is not shown.

Martin

  • Author
  • Newbies

Thanks all, I was really trying to avoid having to roll my own... but it looks like I'll have to.

The display part isn't difficult, but I'm not looking forward to the entering dates part. 12 databases, numerous date fields...

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.