summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets/date_picker.js
AgeCommit message (Collapse)Author
2019-01-30[FIX] web: datepicker fallbacks to default english localeJulien (juc) Castiaux
When using the datepicker with norwegian locales, the dates are correctly formatted using the norwegian locale but the name of the months are shown in english. This cause a date validation error and thus it is not possible to change the date. tempusdominus.js uses moment.js to deal with dates, it sometimes copies/creates some and set their option according to the ones given at instantiation time and fallbacks on default options for that are not set. opw-1922437 closes odoo/odoo#30276
2018-11-26[FIX] web: fielddate[time] should select their value when entering themLucas Perais (lpe)
Before this commit, when focusing on a date[time] field, the value was not selected In v11.0, it was This is due mostly because of the migration to BootStrap 4 After this commit, the value inside the input is selected OPW 1911333 closes odoo/odoo#28989
2018-10-10[FIX] web: do not warn on empty fieldMartin Trigaux
If no value is specified on the datefield, do not set a warnfuture message Remove code comment that was referring the condition present at b51b0d66c2f7 but no longer present. Add tests Fixes #27551 closes odoo/odoo#27593
2018-09-17[FIX] web: datepicker: correctly use libAaron Bohy
The datepicker lib has been updated to tempus dominus (BS4) recently, but our code hasn't been adapted correctly to the requirements of the new version of the lib. As a consequence, the datepicker didn't close itself when the input was focused out anymore. This required a slight change in the DomainSelector widget as it produced a crash when a focused datepicker widget is removed from the DOM (before the datepicker is destroyed), e.g. by a call to html() on one of its parent. Task 1878254
2018-08-29[FIX] web: restore access to minDate/maxDate functions on the DateWidgetPierre Paridans
Used in Enterprise (sale_subscription_dashboard). Solve a traceback as reported on BS4 pad
2018-08-13[IMP] web: Add option on 'Datepicker' to warn when setting date in the futureNicolas Bayet
Purpose ======= There's no generic way to display a warning message if the user tries to set a date in the future. Specification ============= Add this new feature on the datepicker (in web module), and use it account. For example for the invoice date on the invoice/vendor bills form view. TaskID: 1868221
2018-07-27[REF] web, *: update bootstrap-datetimepicker to tempusdominusqsm-odoo
* website_form, debian Our old library for datetimepicker for bootstrap 3 is deprecated and an updated version is developed by the same team under the new name "tempusdominus", for bootstrap 4. The lib is imported by taking the *unminified build* JS and the *src* scss. Odoo is also bundling the lib better by putting the scss file in both backend and frontend assets instead of only in common (so that the scss is compiled differently for the frontend and the backend). Note: the lib also needed to be patched inline to solve a bug at one line.
2018-04-03[FIX] web: time format without secondsGoffin Simon
Steps to reproduce the issue in 11.0 Enterprise: - Go to the language English - Remove from the time format the seconds - Refresh the page - Go to sales - Create a sales order; Bug: - You get the warning message closes #23596 closes #22027 opw:1829577
2017-12-05[FIX] web,*: time format from user's languageAlexandre Kühn
Before this fix, the chatter always showed dates of messages in military time format. This was not the expected behavior, as the user could have had customize the date and time format in the settings of the current language. Steps to reproduce the issue: 1. Set Odoo in English 2. Settings > Translations > Languages > English 2.1. Set Date Format to %m/%d/%Y 2.2. Set Time Format to %I:%M:%S %p 3. CRM > (Select any opportunity with at least one message) > Mouse hover on elapsed time (e.g. "an hour ago") Expected: - It shows the customized time format (e.g. 11/07/2017 5:33:36 PM) Results: - It shows the military time format (e.g. Tue Nov 07 2017 17:33:36 GMT+0100) opw-781647
2017-09-21[MERGE] forward port branch saas-17 up to bf4ccb21f6cChristophe Simonis
2017-09-21[FIX] web: open domain selector's datepicker at the right positionqsm-odoo
Before this commit, and since the combination of new views + datepicker library update, the datepicker opened at the top left of the window when using it in a domain selector. It also could not be used at all. This was because the current scenario occured: 1) Click on the datepicker 2) The datepicker triggers that it has changed on opening 3) The whole domain selector is rerendered 4) The datepicker computes where it should open... on basis of the old destroyed domain selector As the main cause of the problem here was the (2), this commit changes the datepicker odoo widget to only notifies that it has changed when it has really changed.
2017-09-18[FIX] *: fix a bunch of incorrectly documented docstringXavier Morel
Fix a bunch of ill-documented/incomplete/incorrect method docs Without this, the automatic doc generation does not work.
2017-09-07[IMP] web: improved date field usabilitySanjay Jamod
- datepicker doesn't default to current date by default - date string in the input is now selected when clicking the field - adapted the existing tests to the new changes
2017-06-09[MERGE] forward port branch saas-15 up to 49f819a7a79Christophe Simonis
2017-06-07[FIX] web: restore broken datepicker since lib updateqsm-odoo
There were two main problems with the datepicker since the lib was updated: - it appeared broken in the search view "Filters" menu - it did not overflow the parent which scrolls Indeed, before the update, the datepicker was placed in the <body/>. Now this is a lib option. Unfortunately, the option is broken (I don't know why they broke it since it worked before the lib update...). As the lib does not expose its internal functions, the only found workaround was to patch the lib code itself. opw-745311 opw-745625
2017-05-15[IMP] web: update datepicker syntax with the new guidelinesChristophe Matthieu
2017-05-15[FIX] web: datepicker did not select correct date after initial renderChristophe Matthieu
2017-04-19[FIX] web: use correct timezone for date fieldsChristophe Matthieu
before this commit when toggling allday flag in calendar form view, it was possible to have one day error. The input datetime is wrong when the user don't use the datepicker widget (insert date by keypress instead of click on datepicker) sometimes, the value could be null (crash because try to clone false)
2017-04-18[FIX] web: date_picker empty input fieldPierre Masereel
When you try to empty a date or datetime field, you get a traceback saying that 'clone' and 'isSame' are not functions. This error occurs when you empty the field because the value is 'false' and you cannot call 'clone' or 'isSame' on false. To fix this, we ensure that value is not false before calling these methods on it. This bug has been introduced in rev: https://github.com/odoo/odoo/commit/c32724eae06c987e74a0600f1669696e499edc33
2017-04-13[FIX] web: calendar timezone with user configurationChristophe Matthieu
The client must receive the tzOffset to apply this on all hours. To use the date picker we must change the date to apply the change in the user's tzOffset, without this change the result is wrong. For datetime widget we must change like it to avoid max stack error. The server send the tzOffset, if it's undefined, by default the client use the browser time offset. Every test are change to use tzOffset. A test is added in calendar to use the click by position for the fullcalendar lib. This test create and drag and drop an event to check timezone error and error when we use default value in the context. Use formating date like 2026-04-04T08:00:00Z instead of 2026-04-04 08:00:00 is important for phantomjs, because it's crash without information if the formating is not the standard format. For the parsing, when the client receive a server date the date is utc formating but when it's parsed from the client is in the user's timezone
2017-04-11[FIX] web: fix FieldDate widget default valueGéry Debongnie
The FieldDate widget did not properly select the correct default value when opening the datepicker. We did not notice it, because the test hardcoded the february month.
2017-04-11[REF] web,*: improve the way field_utils are doneGéry Debongnie
We replace a bunch of formatting and parsing functions by an object (parse or format) which can be used to dispatch on the correct type. It allows us to remove the format_field and parse_field functions. Also, we camelcase our new code and add some comments.
2017-04-11[REF] web: remove format.jsChristophe Matthieu
use 'web.field_utils' instead of 'web.formats'
2017-04-11[REF] web, *: redesign all JS viewsGéry Debongnie
This commit introduce a full redesign of all JS views. We started basically from scratch. The goal was to unify all the various views under a common framework, to make them testable, to make then usable in different conditions (in studio, or in the frontend), and to make our lives easier. Some important points are: - we introduced new coding guidelines (camelCase, 80 chars width, ...) - we have a brand new testing framework (still QUnit based) - kanban view moved to the web addon - calendar view (formerly web_calender) moved to web as well - the tree view was removed - all new code should be documented We hope that this code is the start of a new era for the Odoo web client, we want to have a high quality codebase, well documented, well tested, well designed. Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-02-14[FIX] web: caret misplacedfwi-odoo
Due to the library algorithm to place the datetimepicker, the div containing the input was no longer relative so the caret was misplaced. Put back the position relative and place the datetimepicker relative to the input.
2017-02-08[FIX] web: use the default library behaviourfwi-odoo
The library reset the time set when the date is changed. Then it was not possible to set the time then set the date and expect the widget to close since the time will be reset to the default value. Instead we use the library behaviour and add a 'close' button for the datetime widgets.
2017-01-30[IMP] web: various imp for the datetimepicker widgetfwi-odoo
* toggle datetimepicker when field is clicked * close datetimepicker when a date is chosen * disable keyboard navigation in the widget to allow modification of input
2017-01-30[REF] web: update bootstrap-datetimepicker lib and adapt datepicker widgetfwi-odoo
from 3.0.3 to 4.17.42
2015-10-07[FIX] web: set the formatted date in the datepickerDanimar Ribeiro
Fixes #8867 Closes #8905
2015-09-24 [REF] web: datepicker widgetqsm-odoo
(backport of enterprise version) * JS/XML refactoring * Allow user to override default options for the picker
2015-09-23[MERGE] forward port of branch saas-6 up to a669433Christophe Simonis
2015-06-10[FIX] web: datetime widget didn't detect all changesGéry Debongnie
The datetime widget use the "keypress" event to detect if it has been changed. Unfortunately, some keys, such as backspace, do not fire a keypress event. This commit listen instead on the 'change' event, which should fire when the input has changed.
2015-03-18[IMP] web+addons: improvement to module systemGéry Debongnie
The module system needs to know the dependencies of a given module before executing the function. This is why the dependencies were defined once in an array, and then were described one more times in the call to require. But a trick can simplify this: the boot function can parse the string representation of the module and extract the calls to require from it. It is more work for the processor, but it leads to simpler module definitions.
2015-03-18[REF] web: add module system to the web clientGéry Debongnie
This commit introduces a new module system for the javascript code. Instead of using global (namespaced) variables everywhere (like openerp.web.whatever, ...), each file declare one (or more) module with its dependencies. Each module will be loaded after its dependencies, and will be given a reference to the return values. This change is a massive departure from the way the client worked previously. It will sadly break some/most history, but I am sure that the future git ecosystem will allow you to easily browse the history past this revision (one can dream). This commit feature: * main namespace is now odoo instead of openerp * a way to define modules and dependencies (inspired by requirejs) * many files have been splitted in simpler subfiles * basic support for debugging in odoo.__DEBUG__ * no global variable (i.e. nothing in window.openerp) * many bug fixes, many new bugs Future vision: this modularization should simplify future code development, simplify debugging and will allow a serious testing effort