Date selection method and device, medium and product
By generating date selection objects, and automatically selecting and displaying target dates based on time range and date selection rules, the date selection problem in the existing technology is solved, and user experience and operation efficiency are improved.
Patent Information
- Application Number
- CN202510538056.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-12
AI Technical Summary
The existing date selection method is cumbersome and inefficient. Especially in calendar applications and task management systems, users need to manually find and select dates.
By generating date selection objects, automatically select and display target dates based on preselected time range rules and date selection rules, simplifying user operations.
It realizes fast and easy date selection, improves user experience, reduces manual selection steps, and improves operational efficiency.
Smart Images

Figure CN120469756A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of date setting, and in particular to a date selection method, device, medium and product. Background Art
[0002] In modern software development, date selection is a common feature in user interfaces, especially in scenarios where users are required to enter or select dates, such as calendar applications, task management systems, and report generation tools.
[0003] The existing date selection method usually requires the user to search for the date to be selected on the date display interface, and after finding it, select a single date with a single click or multiple dates by clicking one by one, which is cumbersome and inefficient. Summary of the Invention
[0004] The embodiments of the present application provide a date selection method, device, medium, and product that can solve the problem that the existing date selection method is cumbersome and inefficient. To achieve this purpose, the embodiments of the present application provide the following solutions.
[0005] According to one aspect of an embodiment of the present application, a date selection method is provided, comprising:
[0006] Obtaining a date selection request, where the date selection request is triggered based on a date selection object, and the date selection object is generated based on at least one pre-selected date;
[0007] If it is determined that the date selection request is triggered by the date selection object, the target date corresponding to the date selection object is selected and displayed.
[0008] In one possible implementation, generating the date selection object includes:
[0009] The selection information of the time range rule and the date selection rule is obtained, and the date selection object is generated according to the selection information.
[0010] In one possible implementation, selecting and displaying the target date corresponding to the date selection object includes:
[0011] Obtain the time range rule and date selection rule corresponding to the date selection object;
[0012] A date interval is determined according to the time range rule, and a date within the date interval that corresponds to the date selection rule is determined as a target date corresponding to the date selection object.
[0013] In one possible implementation, obtaining selection information of the time range rule and the date selection rule includes:
[0014] Displaying the time range rule and the date selection rule, wherein the time range rule and the date selection rule correspond to different display objects;
[0015] The selection information of the time range rule and the date selection rule is obtained through the display interface of the time range rule and the date selection rule.
[0016] In a possible implementation, obtaining a date selection request includes:
[0017] Displaying a date interface, displaying the date selection object on one side of the date interface, wherein the name of the date selection object is determined based on the target date corresponding to the date selection object;
[0018] A date selection request is acquired according to the trigger information of the date selection object.
[0019] In one possible implementation, the display of the target date includes:
[0020] The date is assigned to allSelectDates, and the target date is highlighted in the date interface based on the allSelectDates.
[0021] In one possible implementation, determining a date interval according to the time range rule, and determining a date within the date interval that corresponds to the date selection rule as a target date corresponding to the date selection object, includes:
[0022] Determine the start time and end time of the date interval according to the time range rule;
[0023] Based on the date selection rule, a target date that matches the date selection rule is filtered out from the date range.
[0024] According to one aspect of an embodiment of the present application, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the above methods.
[0025] According to one aspect of an embodiment of the present application, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-described method when executed.
[0026] According to one aspect of an embodiment of the present application, an embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0027] The beneficial effects of the technical solution provided by the embodiments of the present application are:
[0028] The date selection method provided in the present application obtains a date selection request. The triggering method of the date selection request includes triggering based on a date selection object, and the date selection object is generated based on at least one pre-selected date; if it is determined that the date selection request is triggered by the date selection object, the target date corresponding to the date selection object is selected and displayed. The embodiment of the present application can quickly select a date with the pre-generated date selection object, without the need to search for or manually select a date. The operation is simple and efficient, effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is a brief introduction to the drawings required for describing the embodiments of the present application.
[0030] Figure 1 A flowchart of a date selection method provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of date selection provided in an embodiment of the present application;
[0032] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The following describes the embodiments of the present application in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0034] Those skilled in the art will understand that, unless otherwise stated, the singular forms "a", "an", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements, and / or components, but do not exclude implementation as other features, information, data, steps, operations, elements, components, and / or combinations thereof supported by the present technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can refer to the element and the other element establishing a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here can include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" indicates implementation as "A", or implementation as "A", or implementation as "A and B".
[0035] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0036] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on, or combine with each other, and the same terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0037] The date selection method, device, medium and product provided in this application are intended to solve at least one technical problem existing in the prior art.
[0038] Optionally, the device that executes the date selection method of the present application may be a mobile phone, a tablet computer, a smart watch, or other terminals capable of performing date selection.
[0039] Alternatively, as Figure 1-Figure 2 As shown, the date selection method of this application includes:
[0040] S101: Obtain a date selection request.
[0041] Optionally, the date selection request can be triggered by the user clicking a button, by clicking a specific icon with the mouse, by voice input, or by detecting a specific action (such as an action that requires obtaining date information), or by a request to select a date based on a received instruction.
[0042] Optionally, the triggering manner of the date selection request includes triggering based on a date selection object, where the date selection object is generated based on at least one pre-selected date.
[0043] Optionally, the date selection object can be a shortcut key on the date display interface, and the date selection request is triggered by clicking the shortcut key. The instruction to click the date selection object to generate the date selection request can be generated by touching, clicking the mouse, pressing a specific key, etc.
[0044] Optionally, obtaining the date selection request includes: displaying a date interface, displaying a date selection object on one side of the date interface, and obtaining the date selection request based on trigger information of the date selection object. The name of the date selection object is determined based on the target date corresponding to the date selection object.
[0045] In one embodiment, a date interface is displayed based on a user's instruction or operation, and a date selection object is displayed on the left side of the date interface as a shortcut key. Date information is displayed on the right side of the date interface. The date information may be the date of the current month, or, based on the user's action, the month, a single week, or multiple weeks. If a user clicks the date selection object with a mouse, it is determined that a date selection request has been received.
[0046] Optionally, the date selection request may be a user-input instruction to select one or more specified dates, or may be a request generated by clicking a date on a date interface. After determining that the date selection request is not triggered by a date selection object, the date information in the date selection request is obtained, and the date corresponding to the date information is determined as the target date.
[0047] Optionally, generating the date selection object includes: acquiring selection information of the time range rule and the date selection rule, and generating the date selection object according to the selection information.
[0048] Optionally, the time range rules and date selection rules can be preset or generated based on a user input request. The user can enter time range information according to their needs (e.g., the time range is XX year XX month), and the terminal uses this time range information to generate the time range rules. The user can also enter information about the date selection rules (e.g., whether the date is singular or plural, the date is the date of a specific event, a calculation formula for date selection, etc.), and the terminal generates the date selection rules after receiving the date selection rule information.
[0049] Optionally, obtaining selection information for the time range rule and the date selection rule includes: displaying the time range rule and the date selection rule, wherein the time range rule and the date selection rule correspond to different display objects; and obtaining the selection information for the time range rule and the date selection rule through a display interface for the time range rule and the date selection rule. The display object may be a drop-down menu, a corresponding small window, a new page, or other display object.
[0050] In one embodiment, the time range rules and date selection rules may be displayed in the form of a drop-down menu. A user may select the desired time range rules and date selection rules from the drop-down menu. After selecting the desired rule, if an indication confirming the selection is received, a date selection object is generated based on the selected rule.
[0051] Optionally, the time range rule may be this month, this year, or other time ranges, and the date selection rule may be weekdays, weekends, Monday, Tuesday, Wednesday, Thursday, Friday, or other date selection rules.
[0052] Optionally, when the displayed time range rule or date selection rule is not the rule the user needs, the user can also enter an instruction to add a new rule. The terminal can display the rule input interface according to the instruction and generate a new time range rule or date selection rule according to the rule information in the rule input interface.
[0053] In one embodiment, the time range rule indicates the selected time range (such as "this month", "this year"), and the default value is "this month". The date selection rule indicates the selected rule type (such as "weekday", "weekend", "Monday", etc.), and the default value is "weekday". A date selection object can be generated by combining the time range rule and the date selection rule, or by using the time range rule or the date selection rule alone. When the user selects the rules to be combined (such as Rule A and Rule B), and clicks the "OK" button, the terminal combines the currently selected Rules A and B based on the instructions triggered by the button click to generate a new shortcut key.
[0054] Example:
[0055] If rule A is "this month" and rule B is "Monday", the shortcut key {label:"this month's Monday", value:{scope:"currentMonth",ruleType:"monday"}} is generated.
[0056] Optionally, after generating a date selection object, the data allSelectDates can be used to store a set of all selected dates. allSelectDates displays the date selection object in a specific manner (e.g., a specific color or text) based on the stored date selection objects on the display interface. Specifically, allSelectDates can store the date selection object in the form of shortcut keys, each of which includes the shortcut key's display name and the shortcut key's corresponding rule.
[0057] Optionally, the name of the date selection object can be a combination of the names of the rules included in the shortcut key, or can be determined according to a naming instruction input by the user. After selecting the date selection object, the date selection object can also be displayed in a specific color or shape to enable the user to quickly confirm the selected date selection object.
[0058] S102: If it is determined that the date selection request is triggered by the date selection object, the target date corresponding to the date selection object is selected and displayed.
[0059] Optionally, selecting and displaying a target date corresponding to the date selection object includes: obtaining a time range rule and a date selection rule corresponding to the date selection object; determining a date interval according to the time range rule, and determining a date within the date interval corresponding to the date selection rule as the target date corresponding to the date selection object.
[0060] Optionally, if the date selection object only includes a time range rule, you can obtain a date range based on the time range rule, determine the target date for all dates within the date range, and display the target date on the current interface. If the date selection object only includes a date selection rule, you can obtain the currently displayed dates, filter out dates that match the date selection rule, determine the target date as the target date, and highlight it.
[0061] Optionally, a date interval is determined according to a time range rule, and a date within the date interval that corresponds to the date selection rule is determined as a target date corresponding to the date selection object, including: determining a start time and an end time of the date interval according to the time range rule; and filtering out a target date that matches the date selection rule from the date interval based on the date selection rule.
[0062] In one embodiment, information about the time range rule and date selection rule is obtained based on the date selection object. If the date interval corresponding to the time range rule is "this month", the date interval is from the first day to the last day of the current month:
[0063] startDate = new Date(today.getFullYear(), today.getMonth(), 1); / / first day of this month
[0064] endDate = new Date(today.getFullYear(), today.getMonth()+1, 0); / / The last day of this month
[0065] If the date range is "this year", the date range is from the first day to the last day of the current year:
[0066] startDate = new Date(today.getFullYear(),0,1); / / First day of this year
[0067] endDate = new Date(today.getFullYear(),11,31); / / The last day of this year
[0068] For the date selection rule, if the date selection rule is "Monday", the date range is traversed to filter out all Mondays.
[0069] If the date selection rule is "weekday", the date range is traversed to filter out all dates from Monday to Friday.
[0070] If the date selection rule is "weekend", the date range is traversed to filter out all dates that fall on Saturdays and Sundays.
[0071] If the date selection rule is "Tuesday" to "Sunday", traverse the date range and filter out the corresponding day of the week.
[0072] The relevant code for obtaining the target date can be:
[0073]
[0074]
[0075] Optionally, the display of the target date includes: assigning the date to allSelectDates, and highlighting the target date in the date interface based on allSelectDates. Specifically, the target date can be highlighted in a specific color (such as Figure 2 As shown, the target date is displayed in a font (enclosed in a circle) with a gray background.
[0076] The date selection method provided by this application has the following advantages:
[0077] Definition and implementation of shortcut keys: This application introduces shortcut keys to allow users to quickly select dates that conform to specific rules, greatly improving the efficiency of date selection.
[0078] Custom date selection rules: Users can select corresponding date selection rules according to their own needs to meet the needs of different scenarios.
[0079] Automatic date calculation: The component can automatically calculate and select eligible dates based on the rules selected by the user, reducing the user's operation steps.
[0080] Based on the same inventive concept, the embodiment of the present application provides an electronic device, such as Figure 3 As shown, Figure 3 The electronic device 2000 shown includes a processor 2001 and a memory 2003 . The processor 2001 and the memory 2003 are communicatively connected, for example, via a bus 2002 .
[0081] Processor 2001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 2001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0082] Bus 2002 may include a path for transmitting information between the aforementioned components. Bus 2002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, for example. Bus 2002 may be divided into an address bus, a data bus, a control bus, and so on. For ease of illustration, the figure shows only one thick line, but this does not indicate that there is only one bus or only one type of bus.
[0083] The memory 2003 may be a ROM (Read-Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (random access memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read-Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0084] Optionally, the electronic device 2000 may further include a communication unit 2004. The communication unit 2004 may be used to receive and transmit signals. The communication unit 2004 may allow the electronic device 2000 to communicate with other devices wirelessly or by wire to exchange data. It should be noted that in actual applications, the number of communication units 2004 is not limited to one.
[0085] Optionally, the electronic device 2000 may further include an input unit 2005. The input unit 2005 may be configured to receive input digital, character, image, and / or sound information, or to generate key signal input related to user settings and function control of the electronic device 2000. The input unit 2005 may include, but is not limited to, one or more of a touch screen, a physical keyboard, function keys (such as a volume control key, a power key, etc.), a trackball, a mouse, a joystick, a camera, a microphone, and the like.
[0086] Optionally, the electronic device 2000 may further include an output unit 2006. The output unit 2006 may be used to output or display information processed by the processor 2001. The output unit 2006 may include, but is not limited to, one or more of a display device, a speaker, a vibration device, and the like.
[0087] Although the electronic device 2000 is shown with various devices, it should be understood that it is not required to implement or possess all the devices shown, and more or fewer devices may be implemented or possessed instead.
[0088] Optionally, the memory 2003 is used to store a computer program for executing the solution of the present application, and the execution is controlled by the processor 2001. The processor 2001 is used to execute the computer program stored in the memory 2003 to implement the steps of any method provided in the embodiments of the present application.
[0089] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by an electronic device / processor, it implements the steps of any method provided in the present application / implements the steps of various optional implementation methods of the method provided in the present application.
[0090] Based on the same inventive concept, an embodiment of the present application provides a computer program product, which includes a computer program, which, when executed by an electronic device / processor, implements the steps of any method provided in the present application / implements the steps of various optional implementation methods of the method provided in the present application.
[0091] Those skilled in the art will appreciate that the steps, measures, and schemes in the various operations, methods, and processes discussed in this application may be interchanged, modified, combined, or deleted. Furthermore, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be interchanged, modified, rearranged, decomposed, combined, or deleted. Furthermore, steps, measures, and schemes in the related art that are similar to those disclosed in this application may also be interchanged, modified, rearranged, decomposed, combined, or deleted.
[0092] In the description of the present application, the directions or positional relationships indicated by words such as "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", and "outside" are based on the exemplary directions or positional relationships shown in the accompanying drawings. They are for the convenience of describing or simplifying the description of the embodiments of the present application, and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be understood as limitations on the present application.
[0093] The terms "first," "second," "third," "fourth," "1," "2," and the like (if any) in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than that shown or described in the drawings.
[0094] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the order of implementation of these steps is not limited to the order indicated by the arrows. Unless otherwise clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart can include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. Under different scenarios at the execution time, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0095] The above description is only an optional implementation method for some implementation scenarios of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of this application, the use of other similar implementation methods based on the technical ideas of this application also falls within the protection scope of the embodiments of this application.
Claims
1. A date selection method, characterized in that: include: Obtaining a date selection request, where the date selection request is triggered based on a date selection object, and the date selection object is generated based on at least one pre-selected date; If it is determined that the date selection request is triggered by the date selection object, the target date corresponding to the date selection object is selected and displayed.
2. The date selection method according to claim 1, characterized in that: The generation of the date selection object includes: The selection information of the time range rule and the date selection rule is obtained, and the date selection object is generated according to the selection information.
3. The date selection method according to claim 2, characterized in that: The selecting and displaying the target date corresponding to the date selection object includes: Obtain the time range rule and date selection rule corresponding to the date selection object; A date interval is determined according to the time range rule, and a date within the date interval that corresponds to the date selection rule is determined as a target date corresponding to the date selection object.
4. The date selection method according to claim 2, characterized in that: The step of obtaining selection information of the time range rule and the date selection rule includes: Displaying the time range rule and the date selection rule, wherein the time range rule and the date selection rule correspond to different display objects; The selection information of the time range rule and the date selection rule is obtained through the display interface of the time range rule and the date selection rule.
5. The date selection method according to claim 1, wherein: The request to obtain a date selection includes: Displaying a date interface, displaying the date selection object on one side of the date interface, wherein the name of the date selection object is determined based on the target date corresponding to the date selection object; A date selection request is acquired according to the trigger information of the date selection object.
6. The date selection method according to claim 5, characterized in that: The display of the target date includes: The date is assigned to allSelectDates, and the target date is highlighted in the date interface based on the allSelectDates.
7. The date selection method according to claim 3, characterized in that: The determining of a date interval according to the time range rule, and determining a date within the date interval corresponding to the date selection rule as a target date corresponding to the date selection object, includes: Determine the start time and end time of the date interval according to the time range rule; Based on the date selection rule, a target date that matches the date selection rule is filtered out from the date range.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Date sequence generation method and device, equipment and storage medium
CN115641104A