B4A Library [Class] AnotherDatePicker - A simple "web style" date picker

Status
Not open for further replies.

FrankBerra

Active Member
Licensed User
Longtime User
After upgrading to the last version the hint text is not displayed anymore. And also it seems that changing the text alignment and the background color in the designer settings doesn't produce any changes. Am I missing something?
 

Mandrake

Member
Licensed User
Longtime User
Hello need the datepicker in my project but as I can do 'm new to this.
The example does not work
 

Attachments

  • erroandroid.jpg
    183.5 KB · Views: 243

Jose Luis Barajas

Member
Licensed User
Longtime User
Help with AnotherDatePicker in CustomListView

Hi

I like to add this control on customlisvtiew,

When compile my project I get this error

B4A version: 5.80
Parsing code. (0.23s)
Compiling code. (0.31s)
Compiling layouts code. (0.01s)
Generating R file. (0.06s)
Compiling debugger engine code. (1.17s)
Compiling generated Java code. Error
B4A line: 719
Dim tDatePicker As AnotherDatePicker = p.GetView(
javac 1.7.0_55
src\b4a\docucad\enter\code.java:1451: error: inconvertible types
_tdatepicker = (b4a.docucad.enter.anotherdatepicker)(_p.GetView(_idx_datepicker).getObject());
^
required: anotherdatepicker
found: View


The line tha kill the process its

Dim tDatePicker As AnotherDatePicker = p.GetView(0)

Please, can help me, I need to include this control on customlistview

Thanks
 

Douglas Farias

Expert
Licensed User
Longtime User
@Erel i have a simple question
Where change the top blue color (where is the spinner´s) and the corner radius? i not found this.



On the designer i found only background, select and highlighted color.
And on the class code i dont found any RGB, blue, cyan etc..


thx
 

Wolli013

Well-Known Member
Licensed User
Longtime User
'Spinner Hintergrundfarbe setzen

B4X:
Dim ActionbarFarbe As Int = -16729601
   Years.DropdownBackgroundColor =  ActionbarFarbe
   Months.DropdownBackgroundColor =  ActionbarFarbe
 

JOTHA

Well-Known Member
Licensed User
Longtime User
You can use:
B4X:
DateTime.DateFormat = DateTime.DeviceDefaultDateFormat
Sorry ... that causes a NumberFormatException: Invalid double: "invalid date"

The original code is
B4X:
DateTime.DateFormat = "GGyyyyMMdd"
... but why is it not possible to use
B4X:
DateTime.DateFormat = "dd.MM.yyyy"

How can I get the correct result of the Dateformat for today in Germany = "30.08.2016" in Label1.Text?
 

DonManfred

Expert
Licensed User
Longtime User
Error: Invalid value: n. Chr.20160830 000000
Was ist denn das für ein Datumsformat??? Wo kommt das her in dieser Form?

but why is it not possible to use
Warum sollte das nicht gehen?
B4X:
    DateTime.DateFormat =    "dd.MM.yyyy"   
    Dim heute As Long = DateTime.DateParse("19.12.1968")
    Log(DateTime.Date(heute))
 
Last edited:

JOTHA

Well-Known Member
Licensed User
Longtime User
Das wüßte ich auch gerne ... es ist wohl das Ergebnis von DateTime.DateFormat = "GGyyyyMMdd"
In diesem Datum sehe ich 2016.08.30 + Uhrzeit 00:00:00 (heutiges Datum um 00:00:00 Uhr)

Mit deinem Code kommt diese Fehlermeldung:
 

JOTHA

Well-Known Member
Licensed User
Longtime User
Falsch!

DAS ist der Output

** Activity (main) Create, isFirst = true **
19.12.1968

Die Fehlermeldung kommt von einem anderen Code.

Yes thats right, the error message ist the result of that code:
B4X:
Public Sub SetDateAndTime(Years As Int, Months As Int, Days As Int, Hours As Int, Minutes As Int, Seconds As Int) As Long
   
    Dim df = DateTime.DateFormat, tf = DateTime.TimeFormat As String
    DateTime.DateFormat = "GGyyyyMMdd"  '-- Original --   
    DateTime.TimeFormat = "HHmmss"
    Dim d As String = Format(Abs(Years), 4) & Format(Months, 2) & Format(Days, 2)
    d = GetEra(Years < 0) & d
    Dim t As String = Format(Hours, 2) & Format(Minutes, 2) & Format(Seconds, 2)
   
    Try
        Dim ticks As Long = DateTime.DateTimeParse(d, t)
    Catch
        DateTime.DateFormat = df
        DateTime.TimeFormat = tf
            Log("--> Error: Invalid value = Fehler: ungültiger Wert " & d & " " & t)
        Return "--> invalid date = ungültiges Datum" + 1 'hack to throw an error
    End Try
   
    DateTime.DateFormat = df
    DateTime.TimeFormat = tf
        Log("Datum: "&df&" - Uhrzeit: "&tf&"")
    Return ticks

Only the DateTime.DateFormat = "GGyyyyMMdd" is alowed.
This generates the Error: Invalid value: n. Chr.20160830 000000, if you change DateFormat the into DateTime.DateFormat = "dd.MM.yyyy"
 

tiziana.tinnirello

Member
Licensed User
Longtime User
ADP in debug mode works well, in release mode does not show nothing. Help !

EDIT: Solved, moved load layout in Activity_Resume with IsInizialized check
 
Last edited:

daveinhull

Active Member
Licensed User
Longtime User
HI,

Quick question which I can't seem to find any earlier reference to; how can I detect when 'anotherdatepicker' loses focus?

Appreciate any help

Thanks
Dave
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…