[Input widgets]
Object Functions
DateInput object.

DateInput Properties. (After successfully uploading a DateInput object to the QEC master, clicking it will bring up the almanac)


Identifier:
- ID: Unique number that identifies the object.
- Name: User-definable name for the object. It can be used with 86HMI API.
Content:
- Date: Default Date.
Geometry:
- X: Object X coordinate.
- Y: Object Y coordinate.
- Width: Object width.
- Height: Object height.
Options:
- DateDisplay: Date display type. There are 6 formats to choose from.
- TextFont: Choose from 6 default font styles. For font configuration instructions, please refer to Theme Management.
- Order: Object order. It can adjust the object order by up/down, which can be viewed on the Object List.
API Functions
setDateInput()
Description
Set DateInput year/month/day.
Syntax
void setDateInput(lv_obj_t* id, int year, int month, int day);
void setDateInput(char* name, int year, int month, int day);
Parameters
[in] id
Object ID.[in] name
Object Name.[in] year
DateInput year.[in] month
DateInput month.[in] day
DateInput day.
Return
None.
Example
#include "myhmi.h"
void setup() {
Serial.begin(115200);
while (!Serial);
Hmi.begin();
// ...
Hmi.setDateInput(p1din1, 2024, 10, 1);
}
void loop() {
// ...
Serial.print("Year: ");
Serial.print(Hmi.getDateInputYear(p1din1));
Serial.print(", Month: ");
Serial.print(Hmi.getDateInputMonth(p1din1));
Serial.print(", Date: ");
Serial.println(Hmi.getDateInputDay(p1din1));
delay(100);
}getDateInputYear()
Description
Get DateInput year.
Syntax
int getDateInputYear(lv_obj_t* id);
int getDateInputYear(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
DateInput year.
Example
#include "myhmi.h"
void setup() {
Serial.begin(115200);
while (!Serial);
Hmi.begin();
// ...
Hmi.setDateInput(p1din1, 2024, 10, 1);
}
void loop() {
Serial.print("Year: ");
Serial.print(Hmi.getDateInputYear(p1din1));
Serial.print(", Month: ");
Serial.print(Hmi.getDateInputMonth(p1din1));
Serial.print(", Date: ");
Serial.println(Hmi.getDateInputDay(p1din1));
delay(100);
}getDateInputMonth()
Description
Get DateInput month.
Syntax
int getDateInputMonth(lv_obj_t* id);
int getDateInputMonth(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
DateInput month.
Example
#include "myhmi.h"
void setup() {
Serial.begin(115200);
while (!Serial);
Hmi.begin();
// ...
Hmi.setDateInput(p1din1, 2024, 10, 1);
}
void loop() {
Serial.print("Year: ");
Serial.print(Hmi.getDateInputYear(p1din1));
Serial.print(", Month: ");
Serial.print(Hmi.getDateInputMonth(p1din1));
Serial.print(", Date: ");
Serial.println(Hmi.getDateInputDay(p1din1));
delay(100);
}getDateInputDay()
Description
Get DateInput Day.
Syntax
int getDateInputDay(lv_obj_t* id);
int getDateInputDay(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
DateInput day.
Example
#include "myhmi.h"
void setup() {
Serial.begin(115200);
while (!Serial);
Hmi.begin();
// ...
Hmi.setDateInput(p1din1, 2024, 10, 1);
}
void loop() {
Serial.print("Year: ");
Serial.print(Hmi.getDateInputYear(p1din1));
Serial.print(", Month: ");
Serial.print(Hmi.getDateInputMonth(p1din1));
Serial.print(", Date: ");
Serial.println(Hmi.getDateInputDay(p1din1));
delay(100);
}Please see the 86HMI Editor User Manual for more instructions on 86HMI widgets and API usage.