PageSourceSearch

https://ffms.pt/themes/custom/ffms_theme/js/components/paragraphs/homepage-chronologies.js?tlrqeh

js ffms.pt collected 2026-09-24 09:09:32 UTC 1,383 bytes, 41 lines download raw bytes

1(function ($, Drupal) {
2  'use strict';
3
4  Drupal.behaviors.homepageCronoParagraph = {
5    attach: function (context) {
6      $(once('homepageAgenda', '.homepage-chronologies'))
7        .each(function () {
8          var _this = $(this);
9
10          validateDate(_this);
11          _this.find('input').keyup(function(e) {
12            validateDate(_this);
13          });
14
15          function validateDate(_this) {
16            var _day = _this.find('.day').val(),
17            _month = _this.find('.month').val(),
18            _year = _this.find('.year').val(),
19            _button = _this.find('.know-more a'),
20            _link = _button.attr('href'),
21
22            today = new Date(),
23            dd = String(today.getDate()).padStart(2, '0'),
24            mm = String(today.getMonth() + 1).padStart(2, '0'), //January is 0!
25            yyyy = today.getFullYear();
26
27            today = mm + '/' + dd + '/' + yyyy;
28
29            if(_day != "" && _month != "" && _year != "" && _year.length == 4) {
30            var _final_date = _month + "/" + _day + "/" + _year,
31            _total_link = _link + "?field_start_date=" + _final_date + "&field_end_date=" + today;
32            _button.attr('href', _total_link);
33              _button.removeClass('disabled');
34            } else {
35              _button.addClass('disabled');
36            }
37          }
38          });
39    },
40  };
41})(jQuery, Drupal);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.