Index: openacs-4/packages/xowiki/xowiki.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v
diff -u -r1.180.2.119 -r1.180.2.120
--- openacs-4/packages/xowiki/xowiki.info 16 Feb 2024 10:31:38 -0000 1.180.2.119
+++ openacs-4/packages/xowiki/xowiki.info 29 Feb 2024 12:58:08 -0000 1.180.2.120
@@ -10,7 +10,7 @@
t
xowiki
-
+
Gustaf Neumann
A xotcl-based enterprise wiki system with multiple object types
2023-07-11
@@ -55,7 +55,7 @@
BSD-Style
2
-
+
Index: openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml,v
diff -u -r1.47.2.26 -r1.47.2.27
--- openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 27 Sep 2023 13:29:37 -0000 1.47.2.26
+++ openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 29 Feb 2024 12:58:08 -0000 1.47.2.27
@@ -33,6 +33,7 @@
Kopiere Eintrag
Neuen Eintrag vom Typ %type% erstellen
Erzeuge diese Seite in der folgenden Sprache
+ Ung�ltige Datumszeitangabe
Tag
Tagen
L�schen
@@ -119,6 +120,8 @@
Wiki FormPages
Von
in %time%
+ Ung�ltige Datumsangabe
+ Ung�ltige Zeitangabe
hat diese Seite ver�ndert w�hrend sie von Ihnen bearbeitet wurde
H�he
Stunde
Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v
diff -u -r1.71.2.31 -r1.71.2.32
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 27 Sep 2023 13:29:37 -0000 1.71.2.31
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 29 Feb 2024 12:58:08 -0000 1.71.2.32
@@ -38,6 +38,7 @@
%errorMsg%
Create new entry of type %type%
Create this page in a different language
+ Invalid datetime string
day
days
Delete
@@ -131,6 +132,8 @@
Wiki FormPages
From
in %time%
+ Invalid date string
+ Invalid time string
has modified this page while you were editing it
Height
hour
Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v
diff -u -r1.284.2.241 -r1.284.2.242
--- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 13 Sep 2023 22:26:37 -0000 1.284.2.241
+++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 29 Feb 2024 12:58:08 -0000 1.284.2.242
@@ -2499,6 +2499,35 @@
}
}
+ text instproc is_clock_string_p {value formats} {
+ #
+ # Checks if a string is a valid clock string according to
+ # specified formats.
+ #
+ # @see clock
+ #
+ # @return 1 or 0
+ #
+ if {$value eq ""} {
+ #
+ # Empty values are fine here, the field may be optional.
+ #
+ return 1
+ }
+ foreach f $formats {
+ try {
+ clock scan $value -format $f
+ } on error {errmsg} {
+ ns_log notice \
+ "text instproc is_clock_string_p" \
+ "'$value' is not in clock format '$f'"
+ } on ok {d} {
+ return 1
+ }
+ }
+ return 0
+ }
+
###########################################################
#
# ::xowiki::formfield::localized_text
@@ -2711,38 +2740,67 @@
# HTML 5 input type "date", to avoid naming conflict with
# pre-existing formfield of type "date"
###########################################################
- Class create h5date -superclass text
+ Class create h5date \
+ -superclass text \
+ -extend_slot_default validator valid_format \
+ -parameter {
+ {formats {"%Y-%m-%d"}}
+ }
+
h5date instproc initialize {} {
next
:type date
}
+ h5date instproc check=valid_format {value} {
+ return [:is_clock_string_p $value ${:formats}]
+ }
+
###########################################################
#
# ::xowiki::formfield::h5time
#
# HTML 5 input type "time", to avoid naming conflict with
# pre-existing formfield of type "time"
###########################################################
- Class create h5time -superclass text
+ Class create h5time \
+ -superclass text \
+ -extend_slot_default validator valid_format \
+ -parameter {
+ {formats {"%H:%M"}}
+ }
+
h5time instproc initialize {} {
next
:type time
}
+ h5time instproc check=valid_format {value} {
+ return [:is_clock_string_p $value ${:formats}]
+ }
###########################################################
#
# ::xowiki::formfield::datetime-local
#
###########################################################
- Class create datetime-local -superclass text
+ Class create datetime-local \
+ -superclass text \
+ -extend_slot_default validator valid_format \
+ -parameter {
+ {formats {"%Y-%m-%dT%H:%M"}}
+ }
+
datetime-local instproc initialize {} {
next
:type datetime-local
}
+ datetime-local instproc check=valid_format {value} {
+ return [:is_clock_string_p $value ${:formats}]
+ }
+
###########################################################
#
# ::xowiki::formfield::time
@@ -6648,13 +6706,13 @@
#:log "time_span initialize [info exists :__initialized], multi=${:multiday} state=${:__state}"
if {${:__state} ne "after_specs"} return
set :widget_type time_span
- if {${:multiday}} {
- set dtend_format DD_MONTH_YYYY_#xowiki.event-hour_prefix#_HH24_MI
- set dtend_display_format %Q_%X
- } else {
- set dtend_format HH24_MI
- set dtend_display_format %X
- }
+ # if {${:multiday}} {
+ # set dtend_format DD_MONTH_YYYY_#xowiki.event-hour_prefix#_HH24_MI
+ # set dtend_display_format %Q_%X
+ # } else {
+ # set dtend_format HH24_MI
+ # set dtend_display_format %X
+ # }
:create_components [subst {
{dtstart {datetime-local,form_item_wrapper_CSSclass=form-inline,label=#xowiki.From#}}
{dtend {h5time,form_item_wrapper_CSSclass=form-inline,label=#xowiki.to#}}