GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

Commit 03fdb5dc authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Somes fixes in the DateBox control.

[GB.WEB.GUI]
* BUG: DateBox: Fix date formatting.
* NEW: DateBox: Set a default width according to the DateTime property.
parent 6bec59fc
Pipeline #241425534 failed with stage
in 25 minutes and 43 seconds
......@@ -31,7 +31,9 @@ End
Public Sub _Render()
Print "<input id=\""; Me.Name; ":entry\" class=\"gw-combobox-text\" type=\"text\" value=\""; Html(Text_Read()); "\""; Me._GetUpdateJS("onchange", "text", "this.value"); ">";
Print "<input id=\""; Me.Name; ":entry\" class=\"gw-combobox-text";
If $bDateTime Then Print " gw-datebox-time";
Print "\" type=\"text\" value=\""; Html(Text_Read()); "\""; Me._GetUpdateJS("onchange", "text", "this.value"); ">";
Print "<div class=\"gw-combobox-arrow\""; Me._GetUpdateJS("onmousedown", "#popup"); "></div>"
'Print "displayCalendar($("; JS(Me.Name & ":entry"); "),'dd/mm/yyyy'"; '"; If(bTime And Not bChooseDate, "dd/mm/yyyy hh:nn", "dd/mm/yyyy");
'Print ",$("; JS(Me.Name); "),false,false);"; '; If(bTime And Not bChooseDate, "true", "false"); ","; If(bSubmit, "true", "false"); ")\"";
......@@ -96,10 +98,12 @@ End
Private Function Text_Read() As String
If Not $dDate Then Return
If $bDateTime Then
Return Format($dDate, gb.GeneralDate)
Return Format($dDate, gb.Standard)
Else
Return Format($dDate, gb.ShortDate)
Return Format($dDate, gb.MediumDate)
Endif
End
......
......@@ -107,24 +107,25 @@
List = [("Élément 1"), ("Élément 2"), ("Élément 3")]
}
{ WebDateBox1 WebDateBox
#MoveScaled(32,1,24,4)
#MoveScaled(32,1,16,4)
DateTime = True
}
{ WebButton4 WebButton
#MoveScaled(57,1,16,4)
#MoveScaled(49,1,16,4)
Text = ("Reload")
ShowArrow = True
}
{ WebFileButton1 WebFileButton
#MoveScaled(74,1,16,4)
#MoveScaled(66,1,16,4)
Text = ("Select file") & "..."
Image = "icon:/small/directory"
}
{ WebProgressBar1 WebProgressBar
#MoveScaled(91,1,24,4)
#MoveScaled(83,1,24,4)
Width = "12em"
}
{ WebButton7 WebButton
#MoveScaled(116,1,4,4)
#MoveScaled(108,1,4,4)
Image = "icon:/small/cancel"
}
}
......
......@@ -768,15 +768,20 @@ TH.gw-table-sortable:hover {
min-height: 2em;
}
.gw-datebox INPUT {
.gw-datebox > INPUT {
width: 100%;
width: 8em;
min-height: 2em;
box-sizing: border-box;
padding: 0 2.25em 0 0.25em;
vertical-align: middle;
}
.gw-datebox.gw-noborder INPUT {
.gw-datebox > INPUT.gw-datebox-time {
width: 12em;
}
.gw-datebox.gw-noborder > INPUT {
border: none;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment