c# SyndicationItem pubdate to GMT - syndication-feed

I've been trying to produce the an RSS feed using the System.ServiceModel.Syndication library..
At the moment it's displaying AEST with +1000 (e.g. Thu, 23 Apr 2015 09:44:29 +1000) but i need it to be produced as GMT (e.g. Sat, 07 Dec 2013 19:39:04 GMT)
Is there a way to set or force the date format for PublishDate property in the SyndicationItem? or defaulted to the server time setting ?

Related

GmailR - attachement won't allow body text to be displayed

I manage to successfully send HTML email with R with attachment.
However Gmail doesn't display the text.
email <-mime() %>%
to("recipient#example.com") %>%
from("sender#example.com") %>%
subject("This is a subject") %>%
html_body("<html><body>I wish <b>to</b> to see this in the body</body></html>")%>%
attach_file("file.csv")
send_message(email)
The screenshots shows the attachment but not the text, also if I check the email content
Originally I thought that the attachment may be visually covering the text, however after checking the html of the email received I concluded that it is not the case.
The same issue hapens on the gmail app on android
Thank you
Here is the orignal email ( I have stripped down the csv encrypted file to a manageable version)
Original message
Message ID <CAK4Nmip7J=zrxtqPCjnmnEOcA#mail.gmail.com>
Created on: 22 November 2016 at 12:43 (Delivered after 0 seconds)
From: guillaume.lombard#company.com
To: guillaume.lombard#company.com
Subject: Weekly Gifts report
Download original Copy to clipboard
Received: from 704816328917 named unknown by gmailapi.google.com with HTTPREST; Tue, 22 Nov 2016 07:43:10 -0500
MIME-Version: 1.0
Date: Tue, 22 Nov 2016 07:43:10 -0500
To: guillaume.lombard#company.com
From: guillaume.lombard#company.com
Subject: Weekly Gifts report
Content-Type: multipart/mixed; boundary=8ae9c0fed8a3
Content-Disposition: inline
Message-Id: <CAK4Nmgvip7J=zrxtQcqxOcA#mail.gmail.com>
--8ae9c04d036fed8a3
MIME-Version: 1.0
Date: Tue, 22 Nov 2016 12:43:12 GMT
Content-Type: text/csv; name=Gifts CVR.csv
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=Gifts CVR.csv; modification-date=Tue, 22 Nov 2016 12:43:12 GMT
IiIsImRhdGUiLCJwYWdlUGF0aCIsIlNlc3Npb25zIiwiU0tVIiwiaXRlbVF1YW50aXR5IiwiaXRl
#
#
#
YS1naWZ0LXNldC10dWJlL253c2FiZ3MvIiwzLCJOV1NBQkdTIixOQSxOQQo=
--8ae9c0446fed8a3--
I was experiencing the exact same issue with attachments hiding the html body of my emails and after almost a day of searching I found a solution.
It turns out this is a known error with the gmailr package resulting from the boundaries of the MIME message not being placed correctly.
The workaround is to add attach_part after you specify your html_body to "add" your html body again. I'm not sure why this works but it does:
# Store html body as a variable
body <- "<html><body>I wish <b>to</b> to see this in the body</body> . </html>"
email <-mime() %>%
to("recipient#example.com") %>%
from("sender#example.com") %>%
subject("This is a subject") %>%
html_body(body)%>%
attach_part(body) %>%
attach_file("file.csv")
For some reason adding attach_part() resolves the boundary issue or at least it did for me. You can monitor this issue on the Package Author's Git Account here: https://github.com/jimhester/gmailr/issues
Although he hasn't committed anything new in over 6 months so it's unlikely to be resolved anytime soon. In the meantime the above work around should work for you!

Sun Mon Tue Wed Thu Fri Sat → Mon Tue Wed Thu Fri Sat Sun

I have purchased a Theme in wp that is using https://fullcalendar.io/
Current Week Structure is → Sun Mon Tue Wed Thu Fri Sat, but
I want it to be like → Mon Tue Wed Thu Fri Sat Sun
This is the theme Demo from where I have purchased Click Here →
The theme owner aid contact to https://fullcalendar.io/, but on their website I find that I have to seek StackOverflow for the support.
You probably have to make a change to the javascript of the theme to accomplish this. Check out the file events.js in the js directory of your theme. Starting on line 48 try replacing this code:
jQuery('#event-calender-widget').fullCalendar({
aspectRatio:1,
events: calenderAjax.events,
With:
jQuery('#event-calender-widget').fullCalendar({
aspectRatio:1,
firstDay:1,
events: calenderAjax.events,
Good luck!
you may take a look at firstDay option of full calendar

Moment time shows midnight, _i and _d properties do not match [duplicate]

This question already has answers here:
Moment.js internal object what is "_d" vs "_i"
(2 answers)
Closed 6 years ago.
I'm using moment.js in my web application and encountered a bug where the time on many objects change to midnight at some point. I'm still trying to hunt down what, if anything triggers this change, but looking at one of the moments, I noticed the _i property shows the original / correct time.
Below is the developer console output of one of the moments in question, mm
_d: Thu Apr 02 2015 00:00:00 GMT-0400 (EDT)
_f: "YYYY-MM-DDTHH:mm:ssZ"
_i: "2015-04-02T12:10:43-04:00"
_isAMomentObject: true
_isUTC: false
_isValid: true
_locale: Locale
_pf: Object
_tzm: -240
mm.toISOString()
// "2015-04-02T04:00:00.000Z"
moment(mm._i).toISOString()
// "2015-04-02T16:10:43.000Z"
What does the _i represent, and why doesn't it match the string output?
It turns out the bug was caused by a combination of 2 bad assumptions I had
calling startOf() mutates the moment, which I did not realize
the Immutable data structure I'm using ignores Objects with custom prototypes, so the moment objects were left mutable
The result was that another part of the application was able to mutate moments that I expected to be immutable
To answer my question though, I found the following
_i is the input when the moment object was originally created, and does not appear to change
_d is a Date object representing the date value after any mutations
mm = moment("2015-04-02T12:10:43-04:00")
mm._i // "2015-04-02T12:10:43-04:00"
mm._d // Thu Apr 02 2015 12:10:43 GMT-0400 (EDT)
mm.startOf('day')
mm._i // "2015-04-02T12:10:43-04:00"
mm._d // Thu Apr 02 2015 00:00:00 GMT-0400 (EDT)

Understanding the "content type" for PDFs in crawling output

Using heritrix, I have crawled a site which contained some PDF files. The crawl log shows that the content type for the pdf link is "application/pdf", whereas the response in .warc file (crawl output) shows that the content type is "application/http" as well as "application/pdf" (see the example below:).
WARC/1.0^M
WARC-Type: response^M
WARC-Target-URI: `http://example.com/b/c/files/abc.pdf`^M
WARC-Date: 2014-05-29T10:48:03Z^M
WARC-Payload-Digest: sha1:JMRPMGSNIPHBPSBNPD2VJ2NIOGD75UUK^M
WARC-IP-Address: 86.36.67.50^M
WARC-Record-ID: <urn:uuid:00c8b80f-2851-42a1-a449-3cd9e238bfe9>^M
**Content-Type: application/http; msgtype=response^M**
Content-Length: 592173^M
WARC-Block-Digest: sha256:0a56d251257dbcbd6a54e19a528a56aae3e0c9e92a6702f4048e3b69bb3e0920^M
^M
HTTP/1.1 200 OK^M
Date: Thu, 29 May 2014 10:48:04 GMT^M
Server: Apache/2.4.4 (Unix) OpenSSL/0.9.7d PHP/5.3.12 mod_jk/1.2.35^M
Last-Modified: Wed, 20 Nov 2013 08:13:50 GMT^M
ETag: "90805-4eb975c6bcb80"^M
Accept-Ranges: bytes^M
Content-Length: 591877^M
Connection: close^M
**Content-Type: application/pdf^M**
followed by the content of the PDF file
I do not understand how this is happening. Can anyone please explain?
The WARC file contains:
First the WARC-Header-Metadata, from the beginning to the first empty line. This header describes what follows, ie. a full http response, with header and content. Hence the content-type to application/http.
Then comes the HTTP-Response-Metadata. This header is the actual HTTP header and describes what follows, ie. a PDF document.

setWeek year detection

Have a look at the year after setWeek
d = Date.today()
Wed Dec 26 2012 00:00:00 GMT+0000 (GMT Standard Time)
d.getWeek()
52
d.setWeek(52)
Mon Dec 23 2013 00:00:00 GMT+0000 (GMT Standard Time)
Anyone knows what this is about? Have I misinterpreted how the setWeek function should work?
I have found an issue in the datejs tracker with this same problem. It's from 2011, though it's still marked as new: setWeek issue
So regarding yor question of "Have I misinterpreted how the setWeek function should work?" I would say that it's a bug in the jdate code.
If you have a look at the datejs source code you will see that setWeek will always move to the Monday of the target week n:
Date.prototype.setWeek = function (n) {
return this.moveToDayOfWeek(1).addWeeks(n - this.getWeek());
};
see: datejs: svn/trunk/src/core.js

Resources