1 2 3// Create a human readble versio of the date rules of a event 4MapasCulturais.createHumanReadableOccurrences = function(frequency, mdate_s, mdate_e, weekDays, hour) { 5 6 var human = ''; 7 8 if (frequency == 'once') { 9 if (!mdate_s) return '...'; 10 human += 'Dia ' + mdate_s.format('D [de] MMMM [de] YYYY'); 11 } else { 12 13 if (!mdate_s || !mdate_e) return '...'; 14 15 if (frequency == 'daily') { 16 human += 'Diariamente'; 17 } else if (frequency == 'weekly') { 18 19 20 if (weekDays.length > 0) { 21 22 if (weekDays[0] == '0' || weekDays[0] == '6') { 23 human += 'Todo '; 24 } else { 25 human += 'Toda '; 26 } 27 28 var count = 1; 29 $.each(weekDays, function(i, v) { 30 var wformat = weekDays.length > 1 ? 'ddd' : 'dddd'; 31 human += moment().day(v).format(wformat); 32 count ++; 33 if (count == weekDays.length) 34 human += ' e '; 35 else if (count < weekDays.length) 36 human += ', ' 37 }); 38 } 39 } 40 41 if (mdate_s.year() != mdate_e.year()) { 42 human += ' de ' + mdate_s.format('D [de] MMMM [de] YYYY') + ' a ' + mdate_e.format('D [de] MMMM [de] YYYY'); 43 } else { 44 if (mdate_s.month() != mdate_e.month()) { 45 human += ' de ' + mdate_s.format('D [de] MMMM') + ' a ' + mdate_e.format('D [de] MMMM [de] YYYY'); 46 } else { 47 human += ' de ' + mdate_s.format('D') + ' a ' + mdate_e.format('D [de] MMMM [de] YYYY'); 48 } 49 } 50 51 52 } 53 54 if (hour) { 55 if (hour.substring(0,2) == '01') 56 human += ' Ã ' + hour; 57 else 58 human += ' Ã s ' + hour; 59 } 60 61 return human; 62 63}; 64
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.